pages/search: actions: discardTab

This commit is contained in:
He4eT 2024-01-21 21:49:45 +01:00
commit f8ec211e19
2 changed files with 20 additions and 4 deletions

View file

@ -15,12 +15,12 @@ export const actionboxHandlers = (commandQuery, store, flush) => {
/* */
'f': switchToTab,
'd': closeTab,
/* */
'c': duplicateTab,
/* TODO */
// 'p': Pin or unpin the tab
// 'm': Mute or unmute the tab
// 's': Put the tab to sleep
's': discardTab,
// 'e': Pop the tab into it's own window with minimal UI
// 'm': Mute or unmute the tab
// 'p': Pin or unpin the tab
}[command] ?? noop(command))(store, label, flush)
}
@ -63,6 +63,14 @@ function closeTab (store, label, flush) {
}
}
function discardTab (store, label, flush) {
const tab = getTabByLabel(store, label)
if (tab) {
flush()
store.actions.discardTab(tab.id)
}
}
function duplicateTab (store, label, flush) {
const tab = getTabByLabel(store, label)
if (tab) {