2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/main/registerProcessListeners.ts
18alantom 33e035e38c chore: shift process listeners back
- cause webpack bundels as mainprocess stuff
2022-03-18 16:02:11 +05:30

19 lines
409 B
TypeScript

import { app } from 'electron';
import { Main } from '../main';
export default function registerProcessListeners(main: Main) {
if (main.isDevelopment) {
if (process.platform === 'win32') {
process.on('message', (data) => {
if (data === 'graceful-exit') {
app.quit();
}
});
} else {
process.on('SIGTERM', () => {
app.quit();
});
}
}
}