mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
34 lines
771 B
TypeScript
34 lines
771 B
TypeScript
import { app } from 'electron';
|
|
// @ts-ignore
|
|
import installExtension, { VUEJS3_DEVTOOLS } from 'electron-devtools-installer';
|
|
import { Main } from '../main';
|
|
|
|
export default function registerAppLifecycleListeners(main: Main) {
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit();
|
|
}
|
|
});
|
|
|
|
app.on('activate', () => {
|
|
if (main.mainWindow === null) {
|
|
main.createWindow();
|
|
}
|
|
});
|
|
|
|
app.on('ready', async () => {
|
|
if (main.isDevelopment && !process.env.IS_TEST) {
|
|
try {
|
|
await installExtension(VUEJS3_DEVTOOLS);
|
|
} catch (e) {
|
|
console.error(
|
|
'Vue Devtools failed to install:',
|
|
(e as Error).toString()
|
|
);
|
|
}
|
|
}
|
|
|
|
main.createWindow();
|
|
});
|
|
}
|