antares/src/main/ipc-handlers/application.ts

21 lines
451 B
TypeScript
Raw Normal View History

2021-10-29 12:58:37 +02:00
import { app, ipcMain, dialog } from 'electron';
2020-07-29 15:56:29 +02:00
export default () => {
ipcMain.on('close-app', () => {
2020-07-29 15:56:29 +02:00
app.exit();
});
ipcMain.on('get-key', async event => {
2021-04-19 19:15:06 +02:00
const key = false;
event.returnValue = key;
});
2021-10-29 12:58:37 +02:00
ipcMain.handle('showOpenDialog', (event, options) => {
return dialog.showOpenDialog(options);
});
ipcMain.handle('get-download-dir-path', () => {
return app.getPath('downloads');
});
2020-07-29 15:56:29 +02:00
};