Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 7, 2024
1 parent 5ab3992 commit 4e3b640
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webextensions/background/api-tabs-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,9 @@ async function onMoved(tabId, moveInfo) {
// already moved
oldPreviousTab = Tab.getTabAt(moveInfo.windowId, moveInfo.toIndex < moveInfo.fromIndex ? moveInfo.fromIndex : moveInfo.fromIndex - 1);
oldNextTab = Tab.getTabAt(moveInfo.windowId, moveInfo.toIndex < moveInfo.fromIndex ? moveInfo.fromIndex + 1 : moveInfo.fromIndex);
if (oldPreviousTab && oldPreviousTab.id == movedTab.id)
if (oldPreviousTab?.id == movedTab.id)
oldPreviousTab = Tab.getTabAt(moveInfo.windowId, moveInfo.toIndex < moveInfo.fromIndex ? moveInfo.fromIndex - 1 : moveInfo.fromIndex - 2);
if (oldNextTab && oldNextTab.id == movedTab.id)
if (oldNextTab?.id == movedTab.id)
oldNextTab = Tab.getTabAt(moveInfo.windowId, moveInfo.toIndex < moveInfo.fromIndex ? moveInfo.fromIndex : moveInfo.fromIndex - 1);
}

Expand Down

0 comments on commit 4e3b640

Please sign in to comment.