diff options
Diffstat (limited to 'src/shared/versions')
-rw-r--r-- | src/shared/versions/index.js | 13 | ||||
-rw-r--r-- | src/shared/versions/storage.js | 7 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/shared/versions/index.js b/src/shared/versions/index.js index ee9f3b5..ba3d183 100644 --- a/src/shared/versions/index.js +++ b/src/shared/versions/index.js @@ -13,13 +13,12 @@ const notificationClickListener = (id) => { browser.notifications.onClicked.removeListener(notificationClickListener); }; -const checkUpdated = () => { - return storage.load().then((prev) => { - if (!prev) { - return true; - } - return manifest.version !== prev; - }); +const checkUpdated = async() => { + let prev = await storage.load(); + if (!prev) { + return true; + } + return manifest.version !== prev; }; const notify = () => { diff --git a/src/shared/versions/storage.js b/src/shared/versions/storage.js index 37603c8..7883258 100644 --- a/src/shared/versions/storage.js +++ b/src/shared/versions/storage.js @@ -1,7 +1,6 @@ -const load = () => { - return browser.storage.local.get('version').then(({ version }) => { - return version; - }); +const load = async() => { + let { version } = await browser.storage.local.get('version'); + return version; }; const save = (version) => { |