Skip to content

Commit

Permalink
Fix direction of the keys. (GoogleChrome#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmedley authored Feb 9, 2024
1 parent c5287cd commit 7326583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api-samples/default_command_override/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
});

0 comments on commit 7326583

Please sign in to comment.