From 84fbfd7ddd242e846e26c57f177a71afbd9131ba Mon Sep 17 00:00:00 2001 From: Emil Kowalski <36730035+emilkowalski@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:22:58 +0100 Subject: [PATCH] Dont dismiss loading toast (#298) * Dont dismiss loading toast * Cleanup --- src/index.tsx | 2 +- src/types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 08686ba..116da33 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -138,7 +138,7 @@ const Toast = (props: ToastProps) => { }, [toast, removeToast, setHeights, offset]); React.useEffect(() => { - if ((toast.promise && toastType === 'loading') || toast.duration === Infinity) return; + if ((toast.promise && toastType === 'loading') || toast.duration === Infinity || toast.type === 'loading') return; let timeoutId: NodeJS.Timeout; let remainingTime = duration; // Pause the timer on each hover diff --git a/src/types.ts b/src/types.ts index f005616..8fca882 100644 --- a/src/types.ts +++ b/src/types.ts @@ -26,6 +26,7 @@ export interface ToastClassnames { error?: string; info?: string; warning?: string; + loading?: string; default?: string; }