From 600c81accea967ce72cb229eda25ab3eb3ad1a87 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 17 Apr 2019 21:35:52 -0500 Subject: [PATCH] Fix platform detection --- public/electron.js | 9 ++++++--- src/index.css | 2 +- src/index.js | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/electron.js b/public/electron.js index 1d6857a..511bc7b 100644 --- a/public/electron.js +++ b/public/electron.js @@ -617,17 +617,20 @@ ipcMain.on(Constants.IPC_Get_Platform, (event) => { .then(data => { platform = data.replace(/(\r\n|\n|\r)/gm,""); event.sender.send(Constants.IPC_Get_Platform_Reply, { - data: platform, + OSPlatform: os.platform(), + Platform: platform, }); }) .catch(() => { event.sender.send(Constants.IPC_Get_Platform_Reply, { - data: platform, + OSPlatform: os.platform(), + Platform: platform, }); }); } else { event.sender.send(Constants.IPC_Get_Platform_Reply, { - data: platform, + OSPlatform: os.platform(), + Platform: platform, }); } }); diff --git a/src/index.css b/src/index.css index 6ab0a31..8fd7ee9 100644 --- a/src/index.css +++ b/src/index.css @@ -15,7 +15,7 @@ --heading_other_text_color: var(--heading_text_color); --text_color_transition: color 0.3s; - --default_font_size: 4.8vmin + --default_font_size: 4vmin } * { diff --git a/src/index.js b/src/index.js index 1a7c5f2..751b905 100644 --- a/src/index.js +++ b/src/index.js @@ -11,12 +11,12 @@ if (!process.versions.hasOwnProperty('electron')) { const ipcRenderer = ((window && window.require) ? window.require('electron').ipcRenderer : null); if (ipcRenderer) { ipcRenderer.on(Constants.IPC_Get_Platform_Reply, (event, arg) => { - if (arg.data === 'linux') { + if (arg.OSPlatform === 'linux') { let root = document.documentElement; root.style.setProperty('--default_font_size', '4.8vmin'); } - ReactDOM.render(, document.getElementById('root')); + ReactDOM.render(, document.getElementById('root')); serviceWorker.unregister(); }); ipcRenderer.send(Constants.IPC_Get_Platform);