Skip to content

Commit 9af09de

Browse files
committed
Dispatch notifier_enabled when permission given if we don't already have it.
1 parent aaa96f1 commit 9af09de

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎src/controllers/organisms/Notifier.js‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,23 @@ module.exports = {
5555
global.Notification.requestPermission(function() {
5656
if (callback) {
5757
callback();
58+
dis.dispatch({
59+
action: "notifier_enabled",
60+
value: true
61+
});
5862
}
5963
});
6064
}
6165

6266
if (!global.localStorage) return;
6367
global.localStorage.setItem('notifications_enabled', 'true');
64-
dis.dispatch({
65-
action: "notifier_enabled",
66-
value: true
67-
});
68+
69+
if (this.havePermission) {
70+
dis.dispatch({
71+
action: "notifier_enabled",
72+
value: true
73+
});
74+
}
6875
}
6976
else {
7077
if (!global.localStorage) return;

0 commit comments

Comments
 (0)