From 3b6e3ca3770dd0a59a1cb67e394c05ac23dd262b Mon Sep 17 00:00:00 2001 From: xuzuodong Date: Mon, 9 Dec 2024 16:28:29 +0800 Subject: [PATCH] fix: cannot close notification manually --- web/app/components/base/toast/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/toast/index.tsx b/web/app/components/base/toast/index.tsx index b1b9ffe8c4e9d8..bfc1f6d8234673 100644 --- a/web/app/components/base/toast/index.tsx +++ b/web/app/components/base/toast/index.tsx @@ -123,7 +123,17 @@ Toast.notify = ({ const holder = document.createElement('div') const root = createRoot(holder) - root.render() + root.render( + {}, + close: () => { + if (holder) + holder.remove() + }, + }}> + + , + ) document.body.appendChild(holder) setTimeout(() => { if (holder)