mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: store: closeCurrentTab
This commit is contained in:
parent
dbb7724253
commit
c6f4fda801
4 changed files with 12 additions and 13 deletions
|
|
@ -31,8 +31,8 @@ function openHelp () {
|
|||
location.href = helpLink
|
||||
}
|
||||
|
||||
function closeCurrentTab () {
|
||||
window.close()
|
||||
function closeCurrentTab (store) {
|
||||
store.actions.closeCurrentTab()
|
||||
}
|
||||
|
||||
function reloadCurrentTab () {
|
||||
|
|
@ -46,11 +46,12 @@ const getTabByLabel = (store, label) => {
|
|||
return tabs.find(tab => tab.label === label)
|
||||
}
|
||||
|
||||
function switchToTab (store, label) {
|
||||
function switchToTab (store, label, flush) {
|
||||
const tab = getTabByLabel(store, label)
|
||||
if (tab) {
|
||||
flush()
|
||||
store.actions.goToTab(tab.id)
|
||||
closeCurrentTab()
|
||||
store.actions.closeCurrentTab()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue