[MM-38570] Fixed the keyboard shortcuts for switching tabs when some tabs are closed (#1739)

This commit is contained in:
Devin Binnie 2021-09-20 09:14:42 -04:00 committed by GitHub
parent c12c9fb2e4
commit fc9bf1e4a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -220,7 +220,7 @@ function createTemplate(config: Config) {
},
});
if (WindowManager.getCurrentTeamName() === team.name) {
team.tabs.slice(0, 9).sort((teamA, teamB) => teamA.order - teamB.order).forEach((tab, i) => {
team.tabs.filter((tab) => tab.isOpen).slice(0, 9).sort((teamA, teamB) => teamA.order - teamB.order).forEach((tab, i) => {
items.push({
label: ` ${getTabDisplayName(tab.name as TabType)}`,
accelerator: `CmdOrCtrl+${i + 1}`,

View file

@ -353,7 +353,7 @@ function initializeViewManager() {
status.viewManager = new ViewManager(status.config, status.mainWindow);
status.viewManager.load();
status.viewManager.showInitial();
status.currentServerName = status.config.teams.find((team) => team.order === 0)?.name;
status.currentServerName = (status.config.teams.find((team) => team.order === status.config?.lastActiveTeam) || status.config.teams.find((team) => team.order === 0))?.name;
}
}