diff --git a/web/app/components/base/toast/index.tsx b/web/app/components/base/toast/index.tsx
index 1f616a722c..51dd4505ca 100644
--- a/web/app/components/base/toast/index.tsx
+++ b/web/app/components/base/toast/index.tsx
@@ -51,12 +51,11 @@ const Toast = ({
'top-0',
'right-0',
)}>
-
@@ -129,11 +128,25 @@ Toast.notify = ({
const holder = document.createElement('div')
const root = createRoot(holder)
- root.render()
+ root.render(
+ { },
+ close: () => {
+ if (holder) {
+ root.unmount()
+ holder.remove()
+ }
+ },
+ }}>
+
+ ,
+ )
document.body.appendChild(holder)
setTimeout(() => {
- if (holder)
+ if (holder) {
+ root.unmount()
holder.remove()
+ }
}, duration || defaultDuring)
}
}