-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Comments
+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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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):
The text was updated successfully, but these errors were encountered: