Skip to content

Commit

Permalink
Allow dismissing toasts with id = 0 (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount authored Jun 14, 2024
1 parent bc74b2d commit a2bbec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Observer {
};

dismiss = (id?: number | string) => {
if (!id) {
if (typeof id !== undefined && id !== '') {
this.toasts.forEach((toast) => {
this.subscribers.forEach((subscriber) => subscriber({ id: toast.id, dismiss: true }));
});
Expand Down

0 comments on commit a2bbec0

Please sign in to comment.