Skip to content

Commit

Permalink
fixes #323
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Neomy committed Nov 9, 2022
1 parent 47cc581 commit c703937
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions v3/worker/menu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ import {interrupts} from './plugins/loader.mjs';
});

const htabs = []; // these are tabs that will be discarded
// discard-tree for Tree Style Tab
if (menuItemId === 'discard-tree' && info.viewType === 'sidebar') {
htabs.push(tab);
await new Promise(resolve => chrome.runtime.sendMessage('[email protected]', {
type: 'get-tree',
tab: tab.id
}, tab => {
const add = tab => {
htabs.push(...tab.children);
tab.children.filter(t => t.children).forEach(add);
};
add(tab);
resolve();
}));
}
// discard-tree for native
if (tab.highlighted && menuItemId === 'discard-tree') { // if a single not-active tab is called
const tbs = tabs.filter(t => t.highlighted);
Expand Down

0 comments on commit c703937

Please sign in to comment.