Fix platform detection
This commit is contained in:
@@ -617,17 +617,20 @@ ipcMain.on(Constants.IPC_Get_Platform, (event) => {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
platform = data.replace(/(\r\n|\n|\r)/gm,"");
|
platform = data.replace(/(\r\n|\n|\r)/gm,"");
|
||||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||||
data: platform,
|
OSPlatform: os.platform(),
|
||||||
|
Platform: platform,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||||
data: platform,
|
OSPlatform: os.platform(),
|
||||||
|
Platform: platform,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||||
data: platform,
|
OSPlatform: os.platform(),
|
||||||
|
Platform: platform,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
--heading_other_text_color: var(--heading_text_color);
|
--heading_other_text_color: var(--heading_text_color);
|
||||||
--text_color_transition: color 0.3s;
|
--text_color_transition: color 0.3s;
|
||||||
|
|
||||||
--default_font_size: 4.8vmin
|
--default_font_size: 4vmin
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ if (!process.versions.hasOwnProperty('electron')) {
|
|||||||
const ipcRenderer = ((window && window.require) ? window.require('electron').ipcRenderer : null);
|
const ipcRenderer = ((window && window.require) ? window.require('electron').ipcRenderer : null);
|
||||||
if (ipcRenderer) {
|
if (ipcRenderer) {
|
||||||
ipcRenderer.on(Constants.IPC_Get_Platform_Reply, (event, arg) => {
|
ipcRenderer.on(Constants.IPC_Get_Platform_Reply, (event, arg) => {
|
||||||
if (arg.data === 'linux') {
|
if (arg.OSPlatform === 'linux') {
|
||||||
let root = document.documentElement;
|
let root = document.documentElement;
|
||||||
root.style.setProperty('--default_font_size', '4.8vmin');
|
root.style.setProperty('--default_font_size', '4.8vmin');
|
||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(<App platform={arg.data} version={packageJson.version}/>, document.getElementById('root'));
|
ReactDOM.render(<App platform={arg.Platform} version={packageJson.version}/>, document.getElementById('root'));
|
||||||
serviceWorker.unregister();
|
serviceWorker.unregister();
|
||||||
});
|
});
|
||||||
ipcRenderer.send(Constants.IPC_Get_Platform);
|
ipcRenderer.send(Constants.IPC_Get_Platform);
|
||||||
|
|||||||
Reference in New Issue
Block a user