mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Merge pull request #1101 from ch-rit/fix-hiding-toast
fixed hiding the toast after content is loaded
This commit is contained in:
commit
003e71d974
1 changed files with 5 additions and 3 deletions
|
|
@ -78,6 +78,7 @@ export const useHandlePlayQueueAdd = () => {
|
||||||
// Allow this to be undefined for "play shuffled". If undefined, default to 0,
|
// Allow this to be undefined for "play shuffled". If undefined, default to 0,
|
||||||
// otherwise, choose the selected item in the queue
|
// otherwise, choose the selected item in the queue
|
||||||
let initialSongIndex: number | undefined;
|
let initialSongIndex: number | undefined;
|
||||||
|
let toastId: string | null = null;
|
||||||
|
|
||||||
if (byItemType) {
|
if (byItemType) {
|
||||||
let songList: SongListResponse | undefined;
|
let songList: SongListResponse | undefined;
|
||||||
|
|
@ -87,9 +88,8 @@ export const useHandlePlayQueueAdd = () => {
|
||||||
timeoutIds.current = {
|
timeoutIds.current = {
|
||||||
...timeoutIds.current,
|
...timeoutIds.current,
|
||||||
[fetchId]: setTimeout(() => {
|
[fetchId]: setTimeout(() => {
|
||||||
toast.info({
|
toastId = toast.info({
|
||||||
autoClose: false,
|
autoClose: false,
|
||||||
id: fetchId,
|
|
||||||
message: t('player.playbackFetchCancel', {
|
message: t('player.playbackFetchCancel', {
|
||||||
postProcess: 'sentenceCase',
|
postProcess: 'sentenceCase',
|
||||||
}),
|
}),
|
||||||
|
|
@ -148,7 +148,9 @@ export const useHandlePlayQueueAdd = () => {
|
||||||
|
|
||||||
clearTimeout(timeoutIds.current[fetchId] as ReturnType<typeof setTimeout>);
|
clearTimeout(timeoutIds.current[fetchId] as ReturnType<typeof setTimeout>);
|
||||||
delete timeoutIds.current[fetchId];
|
delete timeoutIds.current[fetchId];
|
||||||
toast.hide(fetchId);
|
if(toastId){
|
||||||
|
toast.hide(toastId);
|
||||||
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (instanceOfCancellationError(err)) {
|
if (instanceOfCancellationError(err)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue