From 8f331cde227b7629d30caeb0af411564c366f342 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 24 Apr 2019 19:45:03 +0200 Subject: [PATCH] Fix option errors --- background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index 76debad..de17dad 100644 --- a/background.js +++ b/background.js @@ -134,7 +134,7 @@ function handleChanged(delta) { } if (delta.state && delta.state.current === 'complete') { browser.storage.local.get('options').then(obj => { - if (obj.options.clearAfterDownload) { + if (obj.options !== undefined && obj.options.clearAfterDownload) { browser.storage.local.remove('urls'); } }).then(notification('notificationDownloadComplete')); @@ -155,7 +155,7 @@ function handleMessage(message) { } case 'copied': { browser.storage.local.get('options').then(obj => { - if (obj.options.clearAfterCopy) { + if (obj.options !== obj.options.clearAfterCopy) { browser.storage.local.remove('urls'); } }).then(notification('notificationStorageCopied'));