Merge pull request #13020 from vector-im/t3chguy/fix_mac_shortcut

Fix Electron mac-specific shortcut being registered on Web too.
This commit is contained in:
Michael Telatynski 2020-04-03 13:23:13 +01:00 committed by GitHub
commit a377ca7b85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,17 +36,6 @@ import React from "react";
const ipcRenderer = window.ipcRenderer; const ipcRenderer = window.ipcRenderer;
const isMac = navigator.platform.toUpperCase().includes('MAC'); 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 { function platformFriendlyName(): string {
// used to use window.process but the same info is available here // used to use window.process but the same info is available here
if (navigator.userAgent.includes('Macintosh')) { if (navigator.userAgent.includes('Macintosh')) {
@ -228,6 +217,17 @@ export default class ElectronPlatform extends VectorBasePlatform {
this.startUpdateCheck = this.startUpdateCheck.bind(this); this.startUpdateCheck = this.startUpdateCheck.bind(this);
this.stopUpdateCheck = this.stopUpdateCheck.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<{}> { async getConfig(): Promise<{}> {