From e35d56c81cabd6deb2f25b40b6a2789d01c4990e Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sat, 15 Mar 2025 00:19:00 +0100 Subject: [PATCH] Lib: Allow setting timeout in toast helpers --- src/lib/toast.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/toast.ts b/src/lib/toast.ts index b10f8c9..ae8ee67 100644 --- a/src/lib/toast.ts +++ b/src/lib/toast.ts @@ -1,28 +1,28 @@ import type { ToastSettings } from "@skeletonlabs/skeleton"; -export const get_info_toast = (message: string): ToastSettings => { +export const get_info_toast = (message: string, timeout: number = 2000): ToastSettings => { return { message, hideDismiss: true, - timeout: 2000, + timeout, background: "variant-filled-tertiary", }; }; -export const get_warning_toast = (message: string): ToastSettings => { +export const get_warning_toast = (message: string, timeout: number = 2000): ToastSettings => { return { message, hideDismiss: true, - timeout: 2000, + timeout, background: "variant-filled-secondary", }; }; -export const get_error_toast = (message: string): ToastSettings => { +export const get_error_toast = (message: string, timeout: number = 2000): ToastSettings => { return { message, hideDismiss: true, - timeout: 2000, + timeout, background: "variant-filled-primary", }; };