Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for separate maxSnack when persist: true ? #557

Open
Ben-CA opened this issue Mar 31, 2023 · 1 comment
Open

Option for separate maxSnack when persist: true ? #557

Ben-CA opened this issue Mar 31, 2023 · 1 comment

Comments

@Ben-CA
Copy link

Ben-CA commented Mar 31, 2023

I have an application that uses Notistack, and it provides notifications on successes and failures. (e.g. API calls completed)

For successes, I have no persist setting (default: false), and I'd like the maxSnack=3. (They are also dismissible.)

However, for failures, there could be 10, and these are set to persist: true, and I'd like it to only show the most recent 3, but when one is dismissed, keep showing the remainder until all the errors have been seen and manually dismissed.

Ideally, there would be a "hidden queue", so it's only showing 3, but there could be dozens of errors being logged, and then you can cycle through them dismissing them.

Alternately, a second option would be having a separate (higher) count for persisted notifications - so the maxSnack=3 for "regular", and maxSnack=10 for persisted.

Does this make sense? Perhaps I missed something in the documentation, but I'm not seeing a way to support such.

When I have more than the maxSnack with persisted notifications, it throws a console error like this currently and disposes of the prior ones (as noted in the documentation):

image

@rene-stesl
Copy link

+1 Would love to see such option. Usually I don't want to show more than 3 Snackbars, but if there are 3 Snackbars with the persist flag, I don't want to lose them and show e.g. 2 more additional Snackbars to the persited ones if new Snackbars should be shown.
It would be great if the persisted ones could be grouped together in the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants