Skip to content

Commit

Permalink
Dont dismiss loading toast (emilkowalski#298)
Browse files Browse the repository at this point in the history
* Dont dismiss loading toast

* Cleanup
  • Loading branch information
emilkowalski authored Jan 14, 2024
1 parent 60d7131 commit 84fbfd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface ToastClassnames {
error?: string;
info?: string;
warning?: string;
loading?: string;
default?: string;
}

Expand Down

0 comments on commit 84fbfd7

Please sign in to comment.