Fix device names on desktop
Apparently I really had a bad day with includes / indexOfpull/8241/head
parent
91c037e578
commit
9aad7042a2
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue