diff options
author | Daniel Campoverde <alx@sillybytes.net> | 2017-11-06 10:59:19 -0500 |
---|---|---|
committer | Daniel Campoverde <alx@sillybytes.net> | 2017-11-26 12:39:09 -0500 |
commit | 94dedbd0e9b872934ee1d7a6250dcffffd82bed6 (patch) | |
tree | b6e8a2911a6e2fe7a4aeb442bf8266d0a99007d3 /src/background | |
parent | 848b3c097ffb920f2982c3cefd3e58bc7b8029b3 (diff) |
Clean selectPrevSelTab
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/tabs.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/background/tabs.js b/src/background/tabs.js index 06831f8..a908d17 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -1,4 +1,4 @@ -var prevSelTab = 0; +let prevSelTab = 0; const closeTab = (id) => { return browser.tabs.remove(id); @@ -112,12 +112,9 @@ const selectLastTab = () => { }; const selectPrevSelTab = () => { - var tmpPrevSelTab = null; - browser.tabs.query({ currentWindow: true, active: true }).then((tabs) => { + let tmpPrevSelTab = null; + return browser.tabs.query({ currentWindow: true, active: true }).then((tabs) => { tmpPrevSelTab = tabs[0].id; - }); - - return browser.tabs.query({ currentWindow: true }).then((tabs) => { browser.tabs.update(prevSelTab, { active: true }); prevSelTab = tmpPrevSelTab; }); |