From 9b5519e8666c2cda432633f897c76897a4d0c2ee Mon Sep 17 00:00:00 2001 From: Minhaz A V Date: Wed, 23 Mar 2016 15:45:54 +0530 Subject: [PATCH] promise -> callback & setToolbarPersistantHidden moved inline Signed-off-by: Minhaz A V --- src/Notifier.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index 9c78c1e3c0..53d8be6cd6 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -159,7 +159,7 @@ var Notifier = { if (this.isPermissionDefault()) { // Attempt to get permission from user var self = this; - global.Notification.requestPermission().then(function(result) { + global.Notification.requestPermission(function(result) { if (result === 'denied') { dis.dispatch({ action: "notifier_enabled", @@ -225,14 +225,8 @@ var Notifier = { value: this.isEnabled() }); - if (persistent) { - this.setToolbarPersistantHidden(); - } - }, - - setToolbarPersistantHidden: function() { - // update the info to localStorage - if (global.localStorage) { + // update the info to localStorage for persistent settings + if (persistent && global.localStorage) { global.localStorage.setItem('notifications_hidden', 'true'); } },