diff --git a/pages/search/modules/actionboxHandlers.js b/pages/search/modules/actionboxHandlers.js index 9076951..25d78d7 100644 --- a/pages/search/modules/actionboxHandlers.js +++ b/pages/search/modules/actionboxHandlers.js @@ -67,9 +67,6 @@ function duplicateTab (store, label, flush) { const tab = getTabByLabel(store, label) if (tab) { flush() - browser.tabs.create({ - active: false, - url: tab.url, - }).then(store.actions.updateState) + store.actions.createBackgroundTab(tab.url) } } diff --git a/pages/search/modules/store.js b/pages/search/modules/store.js index 0fdc31a..85cd057 100644 --- a/pages/search/modules/store.js +++ b/pages/search/modules/store.js @@ -74,6 +74,12 @@ export const init = ({ browserTabs.remove(id) .then(updateState) }, + createBackgroundTab(url) { + browserTabs.create({ + active: false, + url, + }).then(updateState) + }, updateQuery(query) { state.query = query updateState()