Dispatch notifier_enabled when permission given if we don't already have it.
This commit is contained in:
parent
aaa96f1ac1
commit
9af09de7d4
|
@ -55,17 +55,24 @@ module.exports = {
|
||||||
global.Notification.requestPermission(function() {
|
global.Notification.requestPermission(function() {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback();
|
callback();
|
||||||
|
dis.dispatch({
|
||||||
|
action: "notifier_enabled",
|
||||||
|
value: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!global.localStorage) return;
|
if (!global.localStorage) return;
|
||||||
global.localStorage.setItem('notifications_enabled', 'true');
|
global.localStorage.setItem('notifications_enabled', 'true');
|
||||||
|
|
||||||
|
if (this.havePermission) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: "notifier_enabled",
|
action: "notifier_enabled",
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (!global.localStorage) return;
|
if (!global.localStorage) return;
|
||||||
global.localStorage.setItem('notifications_enabled', 'false');
|
global.localStorage.setItem('notifications_enabled', 'false');
|
||||||
|
|
Loading…
Reference in New Issue