From 018593a6aa950bad3ae79c36167fc73c956c6357 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 17 Mar 2022 18:11:57 -0700 Subject: [PATCH] fix: Toasts hang on screen --- app/components/Toast.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/Toast.tsx b/app/components/Toast.tsx index a859bdf70..ba440f9c5 100644 --- a/app/components/Toast.tsx +++ b/app/components/Toast.tsx @@ -17,7 +17,7 @@ function Toast({ closeAfterMs = 3000, onRequestClose, toast }: Props) { const { action, type = "info", reoccurring } = toast; React.useEffect(() => { - if (toast.timeout) { + if (toast.timeout !== 0) { timeout.current = setTimeout( onRequestClose, toast.timeout || closeAfterMs @@ -41,7 +41,7 @@ function Toast({ closeAfterMs = 3000, onRequestClose, toast }: Props) { }, []); const handleResume = React.useCallback(() => { - if (timeout.current && toast.timeout) { + if (timeout.current && toast.timeout !== 0) { timeout.current = setTimeout( onRequestClose, toast.timeout || closeAfterMs