Skip to content

Commit

Permalink
check if message exists
Browse files Browse the repository at this point in the history
  • Loading branch information
suren-atoyan committed Jan 3, 2024
1 parent ab1bfae commit bb343ce
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/sections/Notifications/Notifier/Notifier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ function Notifier() {
if (options.key && displayed.current.includes(options.key)) return;

// display snackbar using notistack
enqueueSnackbar(message, {
...options,
onExited(event, key) {
// removen this snackbar from the store
actions.remove(key);
removeDisplayed(key);
},
});
if (message) {
enqueueSnackbar(message, {
...options,
onExited(event, key) {
// removen this snackbar from the store
actions.remove(key);
removeDisplayed(key);
},
});
}

// keep track of snackbars that we've displayed
options.key && storeDisplayed(options.key);
Expand Down

0 comments on commit bb343ce

Please sign in to comment.