mirror of https://github.com/vector-im/riot-web
comment removed and localStorage update moved up
Signed-off-by: Minhaz A V <minhazav@gmail.com>pull/21833/head
parent
8191eaa40b
commit
8605ca134e
|
@ -132,8 +132,7 @@ var Notifier = {
|
|||
}
|
||||
}
|
||||
|
||||
if(enable) {
|
||||
// Case when we do not have the permission as 'granted'
|
||||
if (enable) {
|
||||
// Attempt to get permission from user
|
||||
global.Notification.requestPermission(function(result) {
|
||||
if (result !== 'granted') {
|
||||
|
@ -141,14 +140,15 @@ var Notifier = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (global.localStorage) {
|
||||
global.localStorage.setItem('notifications_enabled', 'true');
|
||||
}
|
||||
|
||||
if (callback) callback();
|
||||
dis.dispatch({
|
||||
action: "notifier_enabled",
|
||||
value: true
|
||||
});
|
||||
|
||||
if (!global.localStorage) return;
|
||||
global.localStorage.setItem('notifications_enabled', 'true');
|
||||
});
|
||||
} else {
|
||||
if (!global.localStorage) return;
|
||||
|
|
Loading…
Reference in New Issue