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
|
|
@ -4,6 +4,7 @@ const fuzzysort = window.fuzzysort
|
|||
export const init = ({
|
||||
tabs: browserTabs,
|
||||
onStateUpdate,
|
||||
closeCurrentTab,
|
||||
}) => {
|
||||
/* Initial state */
|
||||
const state = {
|
||||
|
|
@ -66,7 +67,9 @@ export const init = ({
|
|||
goToTab(id) {
|
||||
browserTabs.update(id, { active: true })
|
||||
.then(updateState)
|
||||
.then(closeCurrentTab)
|
||||
},
|
||||
closeCurrentTab,
|
||||
closeTab(id) {
|
||||
browserTabs.remove(id)
|
||||
.then(updateState)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue