mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: extract duplicateTab
This commit is contained in:
parent
ad9f5312f3
commit
e006784421
2 changed files with 7 additions and 4 deletions
|
|
@ -67,9 +67,6 @@ function duplicateTab (store, label, flush) {
|
||||||
const tab = getTabByLabel(store, label)
|
const tab = getTabByLabel(store, label)
|
||||||
if (tab) {
|
if (tab) {
|
||||||
flush()
|
flush()
|
||||||
browser.tabs.create({
|
store.actions.createBackgroundTab(tab.url)
|
||||||
active: false,
|
|
||||||
url: tab.url,
|
|
||||||
}).then(store.actions.updateState)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,12 @@ export const init = ({
|
||||||
browserTabs.remove(id)
|
browserTabs.remove(id)
|
||||||
.then(updateState)
|
.then(updateState)
|
||||||
},
|
},
|
||||||
|
createBackgroundTab(url) {
|
||||||
|
browserTabs.create({
|
||||||
|
active: false,
|
||||||
|
url,
|
||||||
|
}).then(updateState)
|
||||||
|
},
|
||||||
updateQuery(query) {
|
updateQuery(query) {
|
||||||
state.query = query
|
state.query = query
|
||||||
updateState()
|
updateState()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue