diff --git a/src/main/menus/app.ts b/src/main/menus/app.ts index af06a814..440ec769 100644 --- a/src/main/menus/app.ts +++ b/src/main/menus/app.ts @@ -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}`, diff --git a/src/main/windows/windowManager.ts b/src/main/windows/windowManager.ts index 5502c3f1..5b66e79d 100644 --- a/src/main/windows/windowManager.ts +++ b/src/main/windows/windowManager.ts @@ -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; } }