From 34fc04f1ef2ec976771aef731063aaf695275df7 Mon Sep 17 00:00:00 2001 From: William Metcalf Date: Fri, 1 Nov 2019 12:18:20 -0400 Subject: [PATCH] notification can override provider's preventDup --- src/SnackbarProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SnackbarProvider.js b/src/SnackbarProvider.js index c578737d..6a3f76a7 100644 --- a/src/SnackbarProvider.js +++ b/src/SnackbarProvider.js @@ -49,7 +49,7 @@ class SnackbarProvider extends Component { * @returns generated or user defined key referencing the new snackbar or null */ enqueueSnackbar = (message, { key, preventDuplicate, ...options } = {}) => { - if (preventDuplicate || this.props.preventDuplicate) { + if ((preventDuplicate === undefined && this.props.preventDuplicate) || preventDuplicate) { const inQueue = this.queue.findIndex(item => item.message === message) > -1; const inView = this.state.snacks.findIndex(item => item.message === message) > -1; if (inQueue || inView) {