From 590140024274773e2c0449b7c454a2e296437086 Mon Sep 17 00:00:00 2001 From: smastrom Date: Sat, 27 Jan 2024 08:03:04 +0100 Subject: [PATCH] Core - Cleanup some unnecessary code --- packages/notivue/core/createStore.ts | 2 +- packages/notivue/core/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/notivue/core/createStore.ts b/packages/notivue/core/createStore.ts index be84c6a..f4427a9 100644 --- a/packages/notivue/core/createStore.ts +++ b/packages/notivue/core/createStore.ts @@ -202,7 +202,7 @@ export function createAnimations(config: ConfigSlice, items: ItemsSlice, element playClearAll() { const { clearAll = '' } = config.animations.value - items.entries.value.forEach(({ timeout }) => window.clearTimeout(timeout as number)) + items.entries.value.forEach((e) => window.clearTimeout(e.timeout as number)) if (!clearAll || this.isReducedMotion.value) return items.clear() diff --git a/packages/notivue/core/utils.ts b/packages/notivue/core/utils.ts index d6eeb31..e9c4b2b 100644 --- a/packages/notivue/core/utils.ts +++ b/packages/notivue/core/utils.ts @@ -31,7 +31,7 @@ export function mergeNotificationOptions( pushOptions.props ||= {} as T return { - ...(configOptions[pushOptions.type] ?? configOptions.success), + ...configOptions[pushOptions.type], ...configOptions.global, ...pushOptions, ...(pushOptions.type === 'promise' ? { duration: Infinity } : {}), // Force duration infinity