fix tab selection

jh-changes
Shin'ya Ueoka 7 years ago
parent a968a82f08
commit 053a6f0948
  1. 4
      src/background/tabs.js

@ -62,7 +62,7 @@ const selectPrevTab = (current, count) => {
if (tabs.length < 2) { if (tabs.length < 2) {
return; return;
} }
let select = (current - count) % tabs.length; let select = (current - count + tabs.length) % tabs.length;
let id = tabs[select].id; let id = tabs[select].id;
return browser.tabs.update(id, { active: true }); return browser.tabs.update(id, { active: true });
}); });
@ -73,7 +73,7 @@ const selectNextTab = (current, count) => {
if (tabs.length < 2) { if (tabs.length < 2) {
return; return;
} }
let select = (current + count + tabs.length) % tabs.length; let select = (current + count) % tabs.length;
let id = tabs[select].id; let id = tabs[select].id;
return browser.tabs.update(id, { active: true }); return browser.tabs.update(id, { active: true });
}); });