From 9aad7042a2f46839d43bc2d456744adeb283ed61 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Jan 2019 16:53:50 +0000 Subject: [PATCH] Fix device names on desktop Apparently I really had a bad day with includes / indexOf --- src/vector/platform/ElectronPlatform.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index a20b3313211..f4dd3a652d1 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -28,17 +28,17 @@ const ipcRenderer = window.ipcRenderer; function platformFriendlyName(): string { // used to use window.process but the same info is available here - if (navigator.userAgent.indexOf('Macintosh')) { + if (navigator.userAgent.includes('Macintosh')) { return 'macOS'; - } else if (navigator.userAgent.indexOf('FreeBSD')) { + } else if (navigator.userAgent.includes('FreeBSD')) { return 'FreeBSD'; - } else if (navigator.userAgent.indexOf('OpenBSD')) { + } else if (navigator.userAgent.includes('OpenBSD')) { return 'OpenBSD'; - } else if (navigator.userAgent.indexOf('SunOS')) { + } else if (navigator.userAgent.includes('SunOS')) { return 'SunOS'; - } else if (navigator.userAgent.indexOf('Windows')) { + } else if (navigator.userAgent.includes('Windows')) { return 'Windows'; - } else if (navigator.userAgent.indexOf('Linux')) { + } else if (navigator.userAgent.includes('Linux')) { return 'Linux'; } else { return 'Unknown';