diff options
| -rw-r--r-- | src/lib/Notification/Notification.svelte | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Notification/Notification.svelte b/src/lib/Notification/Notification.svelte index 76775ff3..a3271d58 100644 --- a/src/lib/Notification/Notification.svelte +++ b/src/lib/Notification/Notification.svelte @@ -9,7 +9,11 @@ export let onRemove: () => void = () => { }; export let removed = false; -onMount(() => setTimeout(remove, notification.duration)); +onMount(() => { + const removeTimer = setTimeout(remove, notification.duration); + + return () => clearTimeout(removeTimer); +}); const remove = () => { removed = true; |