Skip to content

Commit

Permalink
don't show archived screens with Cmd-P
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka committed Jan 24, 2024
1 parent 2f57a6e commit 3ae38b4
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/app/common/modals/tabswitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,30 @@ class TabSwitcherModal extends React.Component<{}, {}> {
let oSessions = GlobalModel.sessionList;
let oScreens = GlobalModel.screenMap;
oScreens.forEach((oScreen) => {
if (oScreen == null) {
return;
}
if (oScreen.archived.get()) {
return;
}
// Find the matching session in the observable array
let foundSession = oSessions.find((s) => {
if (s.sessionId === oScreen.sessionId && s.archived.get() == false) {
return true;
}
return false;
return s.sessionId == oScreen.sessionId && !s.archived.get();
});

if (foundSession) {
let data: SwitcherDataType = {
sessionName: foundSession.name.get(),
sessionId: foundSession.sessionId,
sessionIdx: foundSession.sessionIdx.get(),
screenName: oScreen.name.get(),
screenId: oScreen.screenId,
screenIdx: oScreen.screenIdx.get(),
icon: this.getTabIcon(oScreen),
color: this.getTabColor(oScreen),
};
this.options.push(data);
if (!foundSession) {
return;
}
let data: SwitcherDataType = {
sessionName: foundSession.name.get(),
sessionId: foundSession.sessionId,
sessionIdx: foundSession.sessionIdx.get(),
screenName: oScreen.name.get(),
screenId: oScreen.screenId,
screenIdx: oScreen.screenIdx.get(),
icon: this.getTabIcon(oScreen),
color: this.getTabColor(oScreen),
};
this.options.push(data);
});

mobx.action(() => {
Expand Down

0 comments on commit 3ae38b4

Please sign in to comment.