Fix direction of the keys.

This commit is contained in:
Joseph Medley
2024-02-08 10:06:00 -08:00
parent b5e36835a3
commit 2bca505756

View File

@@ -13,9 +13,9 @@ chrome.commands.onCommand.addListener(async (command) => {
const lastTab = tabs.length - 1;
let newIndex = -1;
if (command === 'flip-tabs-forward') {
newIndex = activeIndex === 0 ? lastTab : activeIndex - 1;
newIndex = activeIndex === lastTab ? 0 : activeIndex + 1;
}
// 'flip-tabs-backwards'
else newIndex = activeIndex === lastTab ? 0 : activeIndex + 1;
else newIndex = activeIndex === 0 ? lastTab : activeIndex - 1;
chrome.tabs.update(tabs[newIndex].id, { active: true, highlighted: true });
});