From a333610cf90147d72d0d366e6bcec7c5a6832a5a Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 17 Apr 2020 09:44:12 +0200 Subject: [PATCH] Allow passing 0 as duration for toasts Signed-off-by: Christoph Wurst --- lib/toast.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/toast.ts b/lib/toast.ts index e2c021458..56395fea8 100644 --- a/lib/toast.ts +++ b/lib/toast.ts @@ -71,10 +71,9 @@ export function showMessage(text: string, options?: ToastOptions): Toast { } let classes = options.type ?? '' - const toast = Toastify({ text: text, - duration: options.timeout ? options.timeout * 1000 : null, + duration: (options.timeout === null || options.timeout === undefined) ? null : options.timeout * 1000, callback: options.onRemove, onClick: options.onClick, close: options.close,