From e02440aa592acb9857ec078afbf5b681060f9474 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 7 Dec 2025 00:20:56 +0200 Subject: [PATCH] fix(toast): persistent toasts no longer working --- apps/client/src/widgets/Toast.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/Toast.tsx b/apps/client/src/widgets/Toast.tsx index 6026c9171..2bdf7baae 100644 --- a/apps/client/src/widgets/Toast.tsx +++ b/apps/client/src/widgets/Toast.tsx @@ -7,8 +7,6 @@ import { removeToastFromStore, ToastOptionsWithRequiredId, toasts } from "../ser import Icon from "./react/Icon"; import { RawHtmlBlock } from "./react/RawHtml"; -const DEFAULT_DELAY = 3_000; - export default function ToastContainer() { return (
@@ -20,7 +18,8 @@ export default function ToastContainer() { function Toast({ id, title, timeout, progress, message, icon }: ToastOptionsWithRequiredId) { // Autohide. useEffect(() => { - const timerId = setTimeout(() => removeToastFromStore(id), timeout || DEFAULT_DELAY); + if (!timeout || timeout <= 0) return; + const timerId = setTimeout(() => removeToastFromStore(id), timeout); return () => clearTimeout(timerId); }, [ id, timeout ]);