From 32b55cf9e46e9c58626f8087cb8812689335dedb Mon Sep 17 00:00:00 2001 From: rizky Date: Tue, 8 Oct 2024 05:58:06 -0700 Subject: [PATCH] checkpoint toast --- comps/ui/toast.tsx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/comps/ui/toast.tsx b/comps/ui/toast.tsx index 5d61fd7..f1279d9 100755 --- a/comps/ui/toast.tsx +++ b/comps/ui/toast.tsx @@ -45,12 +45,14 @@ export const toast = { ) => { clearTimeout(timer.timeout); timer.timeout = setTimeout(() => { - sonner.success(el, { - ...props, - onDismiss: (t) => { - toast.toasting = toast.toasting.filter((e) => e !== t.id); - }, - }); + toast.toasting.push( + sonner.success(el, { + ...props, + onDismiss: (t) => { + toast.toasting = toast.toasting.filter((e) => e !== t.id); + }, + }) + ); timer.timeout = null; }, timer.limit); }, @@ -60,12 +62,14 @@ export const toast = { ) => { clearTimeout(timer.timeout); timer.timeout = setTimeout(() => { - sonner.error(el, { - ...props, - onDismiss: (t) => { - toast.toasting = toast.toasting.filter((e) => e !== t.id); - }, - }); + toast.toasting.push( + sonner.error(el, { + ...props, + onDismiss: (t) => { + toast.toasting = toast.toasting.filter((e) => e !== t.id); + }, + }) + ); clearTimeout(timer.timeout); timer.timeout = null;