From 8605ca134e60581e18daf4773e0a2aa90944874b Mon Sep 17 00:00:00 2001 From: Minhaz A V Date: Wed, 23 Mar 2016 22:10:33 +0530 Subject: [PATCH] comment removed and localStorage update moved up Signed-off-by: Minhaz A V --- src/Notifier.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index c99b0dde5e..f539fc8bd5 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -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;