Skip to content

Commit

Permalink
Fixup tree after a new tab is inserted middle of a tree by browser.ta…
Browse files Browse the repository at this point in the history
…bs.insertAfterCurrent=true #3217
  • Loading branch information
piroor committed Oct 3, 2022
1 parent 4c33ec3 commit a2730d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webextensions/background/tabs-open.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* The Original Code is the Tree Style Tab.
*
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
* Portions created by the Initial Developer are Copyright (C) 2011-2021
* Portions created by the Initial Developer are Copyright (C) 2011-2022
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): YUKI "Piro" Hiroshi <[email protected]>
Expand Down Expand Up @@ -117,6 +117,9 @@ export async function openURIsInTabs(uris, options = {}) {
const startIndex = Tab.calculateNewTabIndex(options);
log('startIndex: ', startIndex);
const window = TabsStore.windows.get(options.windowId);
if (options.insertBefore ||
options.insertAfter ||
uris.some(uri => uri && typeof uri == 'object' && 'index' in uri))
window.toBeOpenedTabsWithPositions += uris.length;
if (options.isOrphan)
window.toBeOpenedOrphanTabs += uris.length;
Expand Down

0 comments on commit a2730d5

Please sign in to comment.