[MM-48682] Stop user from opening the servers menu when no servers are configured (#2434)

This commit is contained in:
Devin Binnie
2022-11-30 12:08:24 -04:00
committed by GitHub
parent 84ab14eabf
commit 0a32030985
2 changed files with 11 additions and 15 deletions

View File

@@ -254,13 +254,15 @@ export function createTemplate(config: Config, updateManager: UpdateManager) {
role: 'close',
label: isMac ? localizeMessage('main.menus.app.window.closeWindow', 'Close Window') : localizeMessage('main.menus.app.window.close', 'Close'),
accelerator: 'CmdOrCtrl+W',
}, separatorItem, {
}, separatorItem,
...(config.data?.teams.length ? [{
label: localizeMessage('main.menus.app.window.showServers', 'Show Servers'),
accelerator: `${process.platform === 'darwin' ? 'Cmd+Ctrl' : 'Ctrl+Shift'}+S`,
click() {
ipcMain.emit(OPEN_TEAMS_DROPDOWN);
},
}, ...teams.sort((teamA, teamB) => teamA.order - teamB.order).slice(0, 9).map((team, i) => {
}] : []),
...teams.sort((teamA, teamB) => teamA.order - teamB.order).slice(0, 9).map((team, i) => {
const items = [];
items.push({
label: team.name,