From c1da3bf5378692154e77bdd104034d31572bd72e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 3 Apr 2020 13:01:28 +0100 Subject: [PATCH] Fix Electron mac-specific shortcut being registered on Web too. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 5eff4f0f..6b75c1ee 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -36,17 +36,6 @@ import React from "react"; const ipcRenderer = window.ipcRenderer; const isMac = navigator.platform.toUpperCase().includes('MAC'); -// register Mac specific shortcuts -if (isMac) { - registerShortcut(Categories.NAVIGATION, { - keybinds: [{ - modifiers: [Modifiers.COMMAND], - key: Key.COMMA, - }], - description: _td("Open user settings"), - }); -} - function platformFriendlyName(): string { // used to use window.process but the same info is available here if (navigator.userAgent.includes('Macintosh')) { @@ -228,6 +217,17 @@ export default class ElectronPlatform extends VectorBasePlatform { this.startUpdateCheck = this.startUpdateCheck.bind(this); this.stopUpdateCheck = this.stopUpdateCheck.bind(this); + + // register Mac specific shortcuts + if (isMac) { + registerShortcut(Categories.NAVIGATION, { + keybinds: [{ + modifiers: [Modifiers.COMMAND], + key: Key.COMMA, + }], + description: _td("Open user settings"), + }); + } } async getConfig(): Promise<{}> {