mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: actions: pin or unpin tab
This commit is contained in:
parent
f8ec211e19
commit
60d28b9970
2 changed files with 10 additions and 2 deletions
|
|
@ -18,9 +18,8 @@ export const actionboxHandlers = (commandQuery, store, flush) => {
|
|||
/* */
|
||||
'c': duplicateTab,
|
||||
's': discardTab,
|
||||
'p': pinOrUnpinTab,
|
||||
// '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)
|
||||
}
|
||||
|
||||
|
|
@ -78,3 +77,11 @@ function duplicateTab (store, label, flush) {
|
|||
store.actions.createBackgroundTab(tab.url)
|
||||
}
|
||||
}
|
||||
|
||||
function pinOrUnpinTab (store, label, flush) {
|
||||
const tab = getTabByLabel(store, label)
|
||||
if (tab) {
|
||||
flush()
|
||||
store.actions.updateTab(tab.id, {pinned: !tab.pinned})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ export const init = ({
|
|||
'favIconUrl',
|
||||
'id',
|
||||
'label',
|
||||
'pinned',
|
||||
'title',
|
||||
'url',
|
||||
].reduce((acc, x) => (acc[x] = tab[x], acc), {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue