diff --git a/pages/search/modules/actionboxHandlers.js b/pages/search/modules/actionboxHandlers.js index bb174a4..ff1c686 100644 --- a/pages/search/modules/actionboxHandlers.js +++ b/pages/search/modules/actionboxHandlers.js @@ -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}) + } +} diff --git a/pages/search/modules/store.js b/pages/search/modules/store.js index a74d5bb..8b7d076 100644 --- a/pages/search/modules/store.js +++ b/pages/search/modules/store.js @@ -25,6 +25,7 @@ export const init = ({ 'favIconUrl', 'id', 'label', + 'pinned', 'title', 'url', ].reduce((acc, x) => (acc[x] = tab[x], acc), {})