Clean selectPrevSelTab
This commit is contained in:
parent
848b3c097f
commit
94dedbd0e9
1 changed files with 3 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
var prevSelTab = 0;
|
let prevSelTab = 0;
|
||||||
|
|
||||||
const closeTab = (id) => {
|
const closeTab = (id) => {
|
||||||
return browser.tabs.remove(id);
|
return browser.tabs.remove(id);
|
||||||
|
@ -112,12 +112,9 @@ const selectLastTab = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectPrevSelTab = () => {
|
const selectPrevSelTab = () => {
|
||||||
var tmpPrevSelTab = null;
|
let tmpPrevSelTab = null;
|
||||||
browser.tabs.query({ currentWindow: true, active: true }).then((tabs) => {
|
return browser.tabs.query({ currentWindow: true, active: true }).then((tabs) => {
|
||||||
tmpPrevSelTab = tabs[0].id;
|
tmpPrevSelTab = tabs[0].id;
|
||||||
});
|
|
||||||
|
|
||||||
return browser.tabs.query({ currentWindow: true }).then((tabs) => {
|
|
||||||
browser.tabs.update(prevSelTab, { active: true });
|
browser.tabs.update(prevSelTab, { active: true });
|
||||||
prevSelTab = tmpPrevSelTab;
|
prevSelTab = tmpPrevSelTab;
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue