Move getDefaultDeviceName into the Platforms
So we can have a sensible device name on Electron
This commit is contained in:
@@ -35,6 +35,27 @@ function onUpdateDownloaded(ev, releaseNotes, ver, date, updateURL) {
|
||||
});
|
||||
}
|
||||
|
||||
function platformFriendlyName() {
|
||||
console.log(window.process);
|
||||
switch (window.process.platform) {
|
||||
case 'darwin':
|
||||
return 'macOS';
|
||||
case 'freebsd':
|
||||
return 'FreeBSD';
|
||||
case 'openbsd':
|
||||
return 'OpenBSD';
|
||||
case 'sunos':
|
||||
return 'SunOS';
|
||||
case 'win32':
|
||||
return 'Windows';
|
||||
default:
|
||||
// Sorry, Linux users: you get lumped into here,
|
||||
// but only because Linux's capitalisation is
|
||||
// normal. We do care about you.
|
||||
return window.process.platform[0].toUpperCase + window.process.platform.slice(1);
|
||||
}
|
||||
}
|
||||
|
||||
export default class ElectronPlatform extends VectorBasePlatform {
|
||||
setNotificationCount(count: number) {
|
||||
super.setNotificationCount(count);
|
||||
@@ -101,4 +122,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||
// it should exit.
|
||||
electron.ipcRenderer.send('install_update');
|
||||
}
|
||||
|
||||
getDefaultDeviceDisplayName() {
|
||||
return "Riot Desktop on " + platformFriendlyName();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user