Skip to content

Commit

Permalink
Fixed: Preserve history for duplicated tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed May 2, 2021
1 parent c75f328 commit 582096e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/sidebar/actions/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,8 @@ function remuteTabs(tabIds) {
* Duplicate tabs
*/
async function duplicateTabs(tabIds) {
const active = tabIds.length === 1

for (let tabId of tabIds) {
let tab = this.state.tabsMap[tabId]
if (!tab) continue
Expand All @@ -1166,13 +1168,7 @@ async function duplicateTabs(tabIds) {
}

this.actions.setNewTabPosition(index, tab.parentId, tab.panelId)

await browser.tabs.create({
windowId: this.state.windowId,
index,
cookieStoreId: tab.cookieStoreId,
url: Utils.normalizeUrl(tab.url),
})
await browser.tabs.duplicate(tabId, { index, active })
}
}

Expand Down

0 comments on commit 582096e

Please sign in to comment.