Skip to content

Commit 4c42830

Browse files
committed
fix: rendering
1 parent 5fcd15f commit 4c42830

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/beacon-ui/src/ui/toast/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const createToast = (config: ToastConfig) => {
1717
}
1818

1919
const openToast = (config: ToastConfig) => {
20+
console.error('open toast called', config)
2021
initDone ? config$.next(config) : createToast(config)
2122

2223
if (lastTimer) {
@@ -25,7 +26,9 @@ const openToast = (config: ToastConfig) => {
2526
}
2627

2728
lastTimer = config.timer ? setTimeout(() => show$.next(false), config.timer) : undefined
28-
show$.next(true)
29+
30+
show$.next(false)
31+
setTimeout(() => show$.next(true), 50)
2932
}
3033

3134
const closeToast = () => {
@@ -54,6 +57,7 @@ const ToastRoot = (props: ToastConfig) => {
5457
}, [])
5558

5659
useEffect(() => {
60+
console.error('useEffect called', config)
5761
// unmount the component immediately
5862
// if the close icon is clicked
5963
// or whenever closeToast is called.

0 commit comments

Comments
 (0)