aboutsummaryrefslogtreecommitdiff
path: root/src/services/notifications_fetcher
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-08-20 19:58:49 +0300
committerHenry Jameson <me@hjkos.com>2018-08-20 19:58:49 +0300
commit9e78c64d5eecb5f73e4da401dd3baec94e77efd7 (patch)
treedec28d8693a652b2e2ced8bf8405333936ef20de /src/services/notifications_fetcher
parentfa66385c5beb157fe885401f70029ce03f182ba5 (diff)
Hide initial desktop notifications spam when FE is opened and there's a lot of
unseen notifications.
Diffstat (limited to 'src/services/notifications_fetcher')
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index 5aedc4fb..74a4bcda 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -30,6 +30,10 @@ const fetchAndUpdate = ({store, credentials, older = false}) => {
const startFetching = ({credentials, store}) => {
fetchAndUpdate({ credentials, store })
const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })
+ // Initially there's set flag to silence all desktop notifications so
+ // that there won't spam of them when user just opened up the FE we
+ // reset that flag after a while to show new notifications once again.
+ setTimeout(() => store.dispatch('setNotificationsSilence', false), 10000)
return setInterval(boundFetchAndUpdate, 10000)
}