From 494e3e4d5b09ce0803f5a2232ac2da3c2471e203 Mon Sep 17 00:00:00 2001 From: julians Date: Thu, 17 Apr 2025 00:49:07 -0700 Subject: [PATCH 1/2] fix: Remove toasts from the waiting queue if they are dismiss()ed. --- playground/src/components/App.tsx | 12 +++++++++++- src/core/containerObserver.ts | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/playground/src/components/App.tsx b/playground/src/components/App.tsx index acde3d51..9abfd8e9 100644 --- a/playground/src/components/App.tsx +++ b/playground/src/components/App.tsx @@ -22,7 +22,7 @@ window.toast = toast; class App extends React.Component { state = App.getDefaultState(); - toastId: Id; + toastId: Id = -1; resolvePromise = true; static getDefaultState() { @@ -42,6 +42,11 @@ class App extends React.Component { ...App.getDefaultState() }); + clearLast = () => { + toast.dismiss(this.toastId); + this.toastId = -1; + }; + clearAll = () => toast.dismiss(); showToast = () => { @@ -229,6 +234,11 @@ class App extends React.Component { Update +
  • + +