2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

fix: version on develop

- explicitly disable sandbox
This commit is contained in:
18alantom 2023-07-11 11:02:41 +05:30
parent df9b709db3
commit 05475fcacc
2 changed files with 9 additions and 2 deletions

View File

@ -94,6 +94,7 @@ export class Main {
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: false,
preload,
},
autoHideMenuBar: true,

View File

@ -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,
};
});