Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: check for darwin os

Ilian Sapundshieved48d280032c
diff --git a/src/main/electron-tray-menu.ts b/src/main/electron-tray-menu.ts
index f80f4476e..af320004a 100644
--- a/src/main/electron-tray-menu.ts
+++ b/src/main/electron-tray-menu.ts
@@ -17,7 +17,6 @@
*/
import { app, Menu, nativeImage, Tray } from 'electron';
-import prcs from 'process';
let tray = null;
@@ -101,7 +100,7 @@ export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
if (!tray) {
let icon;
- if (prcs.platform === 'darwin') {
+ if (isMacLike) {
icon = nativeImage.createFromDataURL(icon1xMac);
icon.addRepresentation({
scaleFactor: 2.0,
diff --git a/src/main/main.ts b/src/main/main.ts
index 6570dd321..b4c6c1642 100644
--- a/src/main/main.ts
+++ b/src/main/main.ts
@@ -35,6 +35,8 @@ class AppUpdater {
}
}
+let isMacLike = prcs.platform === 'darwin';
+
let mainWindow: BrowserWindow | null = null;
/*let usedWsPort = undefined;
@@ -309,7 +311,7 @@ function buildTrayMenu(i18n) {
quitApp: reloadApp,
},
i18n,
- prcs.platform === 'darwin',
+ isMacLike,
);
}
@@ -542,7 +544,7 @@ app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); //
app.on('window-all-closed', () => {
// Respect the OSX convention of having the application in memory even
// after all windows have been closed
- if (prcs.platform !== 'darwin') {
+ if (isMacLike) {
pm2.stopAll();
globalShortcut.unregisterAll();
app.quit();