From fc0bffda608d81d28d64d8cb20fe616c56185240 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 28 Jul 2022 09:39:24 +0100 Subject: [PATCH] Remove timeoutIds --- packages/client/src/stores/notification.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/client/src/stores/notification.js b/packages/client/src/stores/notification.js index d8ea487fc7..9c3dfd1523 100644 --- a/packages/client/src/stores/notification.js +++ b/packages/client/src/stores/notification.js @@ -4,17 +4,9 @@ import { routeStore } from "./routes" const NOTIFICATION_TIMEOUT = 3000 const createNotificationStore = () => { - const timeoutIds = new Set() let block = false - const store = writable([], () => { - return () => { - timeoutIds.forEach(timeoutId => { - clearTimeout(timeoutId) - }) - store.set([]) - } - }) + const store = writable([]) const blockNotifications = (timeout = 1000) => { block = true @@ -54,10 +46,9 @@ const createNotificationStore = () => { ] }) if (autoDismiss) { - const timeoutId = setTimeout(() => { + setTimeout(() => { dismiss(_id) }, NOTIFICATION_TIMEOUT) - timeoutIds.add(timeoutId) } }