From 4077630a92920dadc7f4bc7b9936f8b74b1bbeb6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 13 Jan 2018 10:19:05 -0500 Subject: [PATCH] update message data keys --- src/background/runtime.background.ts | 4 ++-- src/content/autofiller.js | 4 ++-- src/content/notificationBar.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index d4249578f84..8773014477b 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -269,10 +269,10 @@ export default class RuntimeBackground { const responseVal: any = {}; if (responseCommand === 'notificationBarDataResponse') { responseVal.neverDomains = await this.storageService.get(ConstantsService.neverDomainsKey); - responseVal.disableAddLoginNotification = await this.storageService.get( + responseVal.disabledNotification = await this.storageService.get( ConstantsService.disableAddLoginNotificationKey); } else if (responseCommand === 'autofillerAutofillOnPageLoadEnabledResponse') { - responseVal.enableAutoFillOnPageLoad = await this.storageService.get( + responseVal.autofillEnabled = await this.storageService.get( ConstantsService.enableAutoFillOnPageLoadKey); } diff --git a/src/content/autofiller.js b/src/content/autofiller.js index 3f5f97e07b3..3c8a9f05b88 100644 --- a/src/content/autofiller.js +++ b/src/content/autofiller.js @@ -1,6 +1,5 @@ document.addEventListener('DOMContentLoaded', (event) => { let pageHref = null; - const enabledKey = 'enableAutoFillOnPageLoad'; if ((typeof safari !== 'undefined')) { const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse'; @@ -10,13 +9,14 @@ document.addEventListener('DOMContentLoaded', (event) => { }); safari.self.addEventListener('message', function (msgEvent) { const msg = msgEvent.message; - if (msg.command === responseCommand && msg.data[enabledKey] === true) { + if (msg.command === responseCommand && msg.data.autofillEnabled === true) { setInterval(doFillIfNeeded, 500); } }, false); return; } else { + const enabledKey = 'enableAutoFillOnPageLoad'; chrome.storage.local.get(enabledKey, (obj) => { if (obj && obj[enabledKey] === true) { setInterval(doFillIfNeeded, 500); diff --git a/src/content/notificationBar.js b/src/content/notificationBar.js index d0e353fe7e4..83d01e56bf1 100644 --- a/src/content/notificationBar.js +++ b/src/content/notificationBar.js @@ -31,7 +31,7 @@ document.addEventListener('DOMContentLoaded', function (event) { return; } - if (notificationBarData.disableAddLoginNotification === true) { + if (notificationBarData.disabledNotification === true) { return; }