From 48e4bccf0d24bb6ce53c4ecea567ed7750fe8949 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Jun 2018 20:21:39 +0900 Subject: Use async/await on background --- src/background/components/tab.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/background/components/tab.js') diff --git a/src/background/components/tab.js b/src/background/components/tab.js index b273546..6af3fd7 100644 --- a/src/background/components/tab.js +++ b/src/background/components/tab.js @@ -4,10 +4,9 @@ export default class TabComponent { constructor(store) { this.store = store; - browser.tabs.onActivated.addListener((info) => { - return browser.tabs.query({ currentWindow: true }).then(() => { - return this.onTabActivated(info); - }); + browser.tabs.onActivated.addListener(async(info) => { + await browser.tabs.query({ currentWindow: true }); + return this.onTabActivated(info); }); } -- cgit v1.2.3