Skip to content

Commit

Permalink
fix: version on develop
Browse files Browse the repository at this point in the history
- explicitly disable sandbox
  • Loading branch information
18alantom committed Jul 11, 2023
1 parent df9b709 commit 05475fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class Main {
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: false,
preload,
},
autoHideMenuBar: true,
Expand Down
10 changes: 8 additions & 2 deletions main/registerIpcMainActionListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,17 @@ export default function registerIpcMainActionListeners(main: Main) {
return await getConfigFilesWithModified(files);
});

ipcMain.handle(IPC_ACTIONS.GET_ENV, () => {
ipcMain.handle(IPC_ACTIONS.GET_ENV, async () => {
let version = app.getVersion();
if (main.isDevelopment) {
const packageJson = await fs.readFile('package.json', 'utf-8');
version = (JSON.parse(packageJson) as { version: string }).version;
}

return {
isDevelopment: main.isDevelopment,
platform: process.platform,
version: app.getVersion(),
version,
};
});

Expand Down

0 comments on commit 05475fc

Please sign in to comment.