Merge pull request #3987 from thelounge/xpaw/notif-state

Refresh notification permission state when push is enabled
This commit is contained in:
Pavel Djundik 2020-07-27 11:01:53 +03:00 committed by GitHub
commit 9502b6adf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
});
}