pages/search: store: closeCurrentTab

This commit is contained in:
He4eT 2024-01-21 20:36:39 +01:00
commit c6f4fda801
4 changed files with 12 additions and 13 deletions

View file

@ -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()
}
}