From 1fb1a99ef4f5c66b202cde408331abbb425e83ee Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 7 May 2024 09:04:32 -0400 Subject: [PATCH] Fix clear all bug when promise has neither a pending nor a success/error On resolving a promise, if there is no success/error, then the pending toast needs to be dismissed. But if there was no pending toast, then toast.dismiss() is being called with undefined, which clears all toast. It should only call toast.dimiss() if id exists for the pending toast. --- src/core/toast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/toast.ts b/src/core/toast.ts index 8d15c20a..bd57061e 100644 --- a/src/core/toast.ts +++ b/src/core/toast.ts @@ -123,7 +123,7 @@ function handlePromise( // Remove the toast if the input has not been provided. This prevents the toast from hanging // in the pending state if a success/error toast has not been provided. if (input == null) { - toast.dismiss(id); + if (id) toast.dismiss(id); return; }