diff --git a/src/app/app-menu.ts b/src/app/app-menu.ts index de18d631..0e6f93cf 100644 --- a/src/app/app-menu.ts +++ b/src/app/app-menu.ts @@ -691,14 +691,6 @@ export class AppMenu { windowHandler.createAboutAppWindow(windowName); }, }, - { - click: (_item) => - windowHandler.switchClient(ClientSwitchType.CLIENT_1_5), - visible: isCorp, - type: 'checkbox', - checked: windowHandler.url?.startsWith(CORP_URL + '/client/'), - label: i18n.t('Switch to client 1.5')(), - }, { click: (_item) => windowHandler.switchClient(ClientSwitchType.CLIENT_2_0), diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index c078147d..05a6e46b 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -75,13 +75,12 @@ const windowSize: string | null = getCommandLineArgs( ); export enum ClientSwitchType { - CLIENT_1_5 = 'CLIENT_1_5', CLIENT_2_0 = 'CLIENT_2_0', CLIENT_2_0_DAILY = 'CLIENT_2_0_DAILY', } const MAIN_WEB_CONTENTS_EVENTS = ['enter-full-screen', 'leave-full-screen']; -const EXPORT_LOGS_THROTTLE = 1000; // 1sec +const SHORTCUT_KEY_THROTTLE = 1000; // 1sec export interface ICustomBrowserWindowConstructorOpts extends Electron.BrowserWindowConstructorOptions { @@ -394,12 +393,31 @@ export class WindowHandler { // SDA-3844 - workaround as local shortcuts not working const throttledExportLogs = throttle(() => { exportLogs(); - }, EXPORT_LOGS_THROTTLE); + }, SHORTCUT_KEY_THROTTLE); + const switchToClient2 = throttle(() => { + windowHandler.switchClient(ClientSwitchType.CLIENT_2_0); + }, SHORTCUT_KEY_THROTTLE); + const switchToDaily = throttle(() => { + windowHandler.switchClient(ClientSwitchType.CLIENT_2_0); + }, SHORTCUT_KEY_THROTTLE); this.mainWebContents.on('before-input-event', (event, input) => { if (input.control && input.shift && input.key.toLowerCase() === 'd') { event.preventDefault(); throttledExportLogs(); } + const isCtrlOrMeta = isMac ? input.meta : input.control; + if (this.url && this.url.startsWith('https://corporate.symphony.com')) { + if (isCtrlOrMeta) { + switch (input.key) { + case '1': + switchToClient2(); + break; + case '2': + switchToDaily(); + break; + } + } + } }); if (isMaximized || isMaximizedFlag) { this.mainWindow.maximize(); @@ -2095,9 +2113,6 @@ export class WindowHandler { `localStorage.getItem('x-km-csrf-token')`, ); switch (clientSwitch) { - case ClientSwitchType.CLIENT_1_5: - this.url = this.startUrl + `?x-km-csrf-token=${csrfToken}`; - break; case ClientSwitchType.CLIENT_2_0: this.url = `https://${parsedUrl.hostname}/client-bff/index.html?x-km-csrf-token=${csrfToken}`; break; diff --git a/src/locale/en-US.json b/src/locale/en-US.json index bf2e3da1..cd733025 100644 --- a/src/locale/en-US.json +++ b/src/locale/en-US.json @@ -185,7 +185,6 @@ "Speech": "Speech", "Start Speaking": "Start Speaking", "Stop Speaking": "Stop Speaking", - "Switch to client 1.5": "Switch to client 1.5", "Switch to client 2.0": "Switch to client 2.0", "Switch to client 2.0 daily": "Switch to client 2.0 daily", "Symphony Help": "Symphony Help", diff --git a/src/locale/en.json b/src/locale/en.json index bf2e3da1..cd733025 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -185,7 +185,6 @@ "Speech": "Speech", "Start Speaking": "Start Speaking", "Stop Speaking": "Stop Speaking", - "Switch to client 1.5": "Switch to client 1.5", "Switch to client 2.0": "Switch to client 2.0", "Switch to client 2.0 daily": "Switch to client 2.0 daily", "Symphony Help": "Symphony Help", diff --git a/src/locale/fr-FR.json b/src/locale/fr-FR.json index 3d80826b..b569e440 100644 --- a/src/locale/fr-FR.json +++ b/src/locale/fr-FR.json @@ -185,7 +185,6 @@ "Speech": "Dictée vocale", "Start Speaking": "Commencer à dicter", "Stop Speaking": "Arreter de dicter", - "Switch to client 1.5": "Passer au client 1.5", "Switch to client 2.0": "Passer au client 2.0", "Switch to client 2.0 daily": "Passer à client 2.0 daily", "Symphony Help": "Aide en ligne de Symphony", diff --git a/src/locale/fr.json b/src/locale/fr.json index 3d80826b..b569e440 100644 --- a/src/locale/fr.json +++ b/src/locale/fr.json @@ -185,7 +185,6 @@ "Speech": "Dictée vocale", "Start Speaking": "Commencer à dicter", "Stop Speaking": "Arreter de dicter", - "Switch to client 1.5": "Passer au client 1.5", "Switch to client 2.0": "Passer au client 2.0", "Switch to client 2.0 daily": "Passer à client 2.0 daily", "Symphony Help": "Aide en ligne de Symphony", diff --git a/src/locale/ja-JP.json b/src/locale/ja-JP.json index 8dbd14a7..24b67fcb 100644 --- a/src/locale/ja-JP.json +++ b/src/locale/ja-JP.json @@ -185,7 +185,6 @@ "Speech": "スピーチ", "Start Speaking": "スピーチを開始", "Stop Speaking": "スピーチを終了", - "Switch to client 1.5": "Client 1.5 に切り替え", "Switch to client 2.0": "Client 2.0 に切り替え", "Switch to client 2.0 daily": "Client 2.0 daily に切り替え", "Symphony Help": "Symphonyのヘルプ", diff --git a/src/locale/ja.json b/src/locale/ja.json index a18c033e..f694baf7 100644 --- a/src/locale/ja.json +++ b/src/locale/ja.json @@ -185,7 +185,6 @@ "Speech": "スピーチ", "Start Speaking": "スピーチを開始", "Stop Speaking": "スピーチを終了", - "Switch to client 1.5": "Client 1.5 に切り替え", "Switch to client 2.0": "Client 2.0 に切り替え", "Switch to client 2.0 daily": "Client 2.0 daily に切り替え", "Symphony Help": "Symphonyのヘルプ",