From b7c5f2031cccb835b3eed97d1fd8601635be2792 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 15 Jul 2020 16:08:36 +0300 Subject: [PATCH] Refresh notification permission state when push is enabled --- client/js/webpush.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/js/webpush.js b/client/js/webpush.js index efc72a8a..6f3f8ab7 100644 --- a/client/js/webpush.js +++ b/client/js/webpush.js @@ -73,11 +73,13 @@ function togglePushSubscription() { .then((subscription) => { socket.emit("push:register", subscription.toJSON()); store.commit("pushNotificationState", "subscribed"); + store.commit("refreshDesktopNotificationState"); }); }) ) .catch((err) => { store.commit("pushNotificationState", "unsupported"); + store.commit("refreshDesktopNotificationState"); console.error(err); // eslint-disable-line no-console }); }