From 16c06da02aeb2b345c68fd732de8dfb479caf657 Mon Sep 17 00:00:00 2001 From: xuzuodong Date: Mon, 9 Dec 2024 16:48:33 +0800 Subject: [PATCH] fix: ensure proper unmounting of Toast component on close --- web/app/components/base/toast/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/toast/index.tsx b/web/app/components/base/toast/index.tsx index bfc1f6d8234673..b9a6de9fe5ac00 100644 --- a/web/app/components/base/toast/index.tsx +++ b/web/app/components/base/toast/index.tsx @@ -127,8 +127,10 @@ Toast.notify = ({ {}, close: () => { - if (holder) + if (holder) { + root.unmount() holder.remove() + } }, }}> @@ -136,8 +138,10 @@ Toast.notify = ({ ) document.body.appendChild(holder) setTimeout(() => { - if (holder) + if (holder) { + root.unmount() holder.remove() + } }, duration || defaultDuring) } }