From b16e09c345b42d3ab219064cdfa8349cab5b20d3 Mon Sep 17 00:00:00 2001 From: satoren Date: Wed, 12 Apr 2023 16:59:22 +0900 Subject: [PATCH] No duplication during closed animation fix #550 --- src/SnackbarProvider/SnackbarProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SnackbarProvider/SnackbarProvider.tsx b/src/SnackbarProvider/SnackbarProvider.tsx index c404716..f421aa7 100644 --- a/src/SnackbarProvider/SnackbarProvider.tsx +++ b/src/SnackbarProvider/SnackbarProvider.tsx @@ -116,7 +116,7 @@ class SnackbarProvider extends Component { hasSpecifiedKey ? item.id === id : item.message === message; const inQueue = state.queue.findIndex(compareFunction) > -1; - const inView = state.snacks.findIndex(compareFunction) > -1; + const inView = state.snacks.filter((item) => item.open).findIndex(compareFunction) > -1; if (inQueue || inView) { return state; }