diff --git a/package.json b/package.json index d686fcda765..e0f7ebe2f93 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "start": "yarn start:browser", - "start:desktop": "npm-run-all --parallel 'start:desktop-*'", + "start:desktop": "yarn rebuild-electron && npm-run-all --parallel 'start:desktop-*'", "start:desktop-node": "yarn workspace loot-core watch:node", "start:desktop-client": "yarn workspace @actual-app/web watch", "start:desktop-electron": "yarn workspace desktop-electron watch", diff --git a/packages/loot-core/src/client/platform.electron.ts b/packages/loot-core/src/client/platform.electron.ts index 690af55963f..57ec58da8f7 100644 --- a/packages/loot-core/src/client/platform.electron.ts +++ b/packages/loot-core/src/client/platform.electron.ts @@ -1,15 +1,17 @@ -const isWindows = - navigator.platform && navigator.platform.toLowerCase() === 'win32'; +const os = require('os'); -const isMac = - navigator.platform && navigator.platform.toUpperCase().indexOf('MAC') >= 0; +const isWindows = os.platform() === 'win32'; +const isMac = os.platform() === 'darwin'; +const isLinux = os.platform() === 'linux'; -export const isPlaywright = navigator.userAgent === 'playwright'; +export const isPlaywright = false; export const OS: 'windows' | 'mac' | 'linux' | 'unknown' = isWindows ? 'windows' : isMac ? 'mac' - : 'linux'; + : isLinux + ? 'linux' + : 'unknown'; export const env: 'web' | 'mobile' | 'unknown' = 'unknown'; export const isBrowser = false;