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

Check for item key when a key is provided to prevent duplicates #190

Merged
merged 3 commits into from
Nov 4, 2019
Merged

Check for item key when a key is provided to prevent duplicates #190

merged 3 commits into from
Nov 4, 2019

Conversation

kriim
Copy link
Contributor

@kriim kriim commented Nov 4, 2019

Currently if you have two notification with the same message text, but a different key, only the message is used to prevent duplicates.

When a user defined key is provided to enqueueSnackbar it makes sense to compare the key instead of the message to prevent duplicates.

This becomes relevant when you pass a React.Node as message. Or when you want to replace a Snackbar with a new one, where the message is the same but the actions are different.

@iamhosseindhv iamhosseindhv merged commit 806cd1b into iamhosseindhv:master Nov 4, 2019
@iamhosseindhv
Copy link
Owner

Thanks for your contribution @kriim .

Documentation website has been updated accordingly. https://iamhosseindhv.com/notistack/demos#prevent-duplicate

@kriim
Copy link
Contributor Author

kriim commented Nov 5, 2019

Wow, thanks, that was quick :). And no problem, I'm glad to help.

How often do you usually publish releases to npm?

@iamhosseindhv
Copy link
Owner

In case of bug fixes I publish immediately. For features I'll publish when it's worth incrementing the version number. In this case changes will be published when #189 gets merged.

@kriim
Copy link
Contributor Author

kriim commented Nov 5, 2019

Sounds good, thanks for the info.

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

Successfully merging this pull request may close these issues.

2 participants