summaryrefslogtreecommitdiffstats
path: root/webapp/src/store/notifications.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/store/notifications.js')
-rw-r--r--webapp/src/store/notifications.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/webapp/src/store/notifications.js b/webapp/src/store/notifications.js
index 9f41d07..4687b78 100644
--- a/webapp/src/store/notifications.js
+++ b/webapp/src/store/notifications.js
@@ -23,10 +23,13 @@ export default {
state.newAlertCount++
state.alerts.unshift(data)
},
- removeAlert (state, a) {
+ removeAlert (state, id) {
+ const a = state.alerts.find(el => el.id === id)
a.show = false
setTimeout(function () {
- state.alerts.splice(state.alerts.indexOf(a), 1)
+ var index = state.alerts.indexOf(a)
+ state.alerts.splice(index, 1)
+ if (index < state.newAlertCount && index >= 0) state.newAlertCount--
}, 200)
},
resetNewAlertCount (state) {