Skip to content

Commit

Permalink
Dismiss toast with id 0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Jun 9, 2024
1 parent bc74b2d commit d64d715
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 d64d715

Please sign in to comment.