From e2d2c43a82c57e81186b355d69d21a6b9b2ef67f Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Tue, 21 Mar 2023 12:43:33 +0000 Subject: [PATCH] refactor: simplify notifications update --- src/lib/stores/notifications.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/stores/notifications.ts b/src/lib/stores/notifications.ts index 397b578e4..26fa69a28 100644 --- a/src/lib/stores/notifications.ts +++ b/src/lib/stores/notifications.ts @@ -33,11 +33,7 @@ export const addNotification = (notification: Omit) => { const n = { ...defaults, ...notification }; notifications.update((all) => { - if (all.length < 3) { - return [n, ...all]; - } else { - return [n, ...all.slice(0, 2)]; - } + return [n, ...all.slice(0, 2)]; }); if (n.timeout) setTimeout(() => dismissNotification(n.id), n.timeout);