From b74acf6f6aef4e4241ba62c72ed8ddb21adc751d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Jun 2018 22:02:32 +0900 Subject: Use await/async on shared directory --- src/shared/versions/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/shared/versions/index.js') 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 = () => { -- cgit v1.2.3