From 43f62720bb5a67354a2f56eef280a1754df57a04 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 15 Mar 2021 08:50:51 +0100 Subject: [PATCH] 1240 - restore notification blocknotifications method, since it was called in the datasource --- packages/client/src/store/notification.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/client/src/store/notification.js b/packages/client/src/store/notification.js index d69a39080e..3efd40a882 100644 --- a/packages/client/src/store/notification.js +++ b/packages/client/src/store/notification.js @@ -13,8 +13,17 @@ const createNotificationStore = () => { _notifications.set([]) } }) + let block = false + + const blockNotifications = (timeout = 1000) => { + block = true + setTimeout(() => (block = false), timeout) + } const send = (message, type = "default") => { + if (block) { + return + } let _id = id() _notifications.update(state => { return [...state, { id: _id, type, message }] @@ -36,6 +45,7 @@ const createNotificationStore = () => { warning: msg => send(msg, "warning"), info: msg => send(msg, "info"), success: msg => send(msg, "success"), + blockNotifications, } }