Skip to content

Commit

Permalink
feat(ui): showToast #2
Browse files Browse the repository at this point in the history
  • Loading branch information
BQXBQX committed Feb 3, 2024
1 parent 58e646a commit 09270bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ui/lib/Toast/showToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const showToast = (props?: ToastProps) => {
toasts.shift();
const firstChild = toastContainer.childNodes[0];
setTimeout(() => {
toastContainer.removeChild(firstChild as Node);
while (toastContainer.childNodes.length > 3) {
toastContainer.removeChild(toastContainer.firstChild!);
}
}, 300);
}

Expand Down

0 comments on commit 09270bf

Please sign in to comment.