diff --git a/stores/notification.ts b/stores/notification.ts index c3a0f96..077efd5 100644 --- a/stores/notification.ts +++ b/stores/notification.ts @@ -7,7 +7,7 @@ import { useColor } from "./color"; const getNotyf = (): Notyf => { if ((window as any).notyf === undefined) { (window as any).notyf = new Notyf({ - duration: 50000, + duration: 5000, dismissible: true, position: { x: "right", @@ -56,6 +56,11 @@ export const useNotification = createGlobalState(() => { payloadValue = { message: payloadValue }; } + // Set default duration if not specified + if (payloadValue.duration === undefined) { + payloadValue.duration = 5000; + } + // payloadValue.type = type; payloadValue.className = `notyf__toast--${type}`; payloadValue.background = colors[type].value;