mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Dispatch notifier_enabled when permission given if we don't already have it.
This commit is contained in:
parent
aaa96f1ac1
commit
9af09de7d4
@ -55,16 +55,23 @@ module.exports = {
|
||||
global.Notification.requestPermission(function() {
|
||||
if (callback) {
|
||||
callback();
|
||||
dis.dispatch({
|
||||
action: "notifier_enabled",
|
||||
value: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!global.localStorage) return;
|
||||
global.localStorage.setItem('notifications_enabled', 'true');
|
||||
dis.dispatch({
|
||||
action: "notifier_enabled",
|
||||
value: true
|
||||
});
|
||||
|
||||
if (this.havePermission) {
|
||||
dis.dispatch({
|
||||
action: "notifier_enabled",
|
||||
value: true
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!global.localStorage) return;
|
||||
|
Loading…
Reference in New Issue
Block a user