feat(ipc): add updater and crash IPC handlers

This commit is contained in:
2026-06-08 06:19:15 +05:30
parent 77ad2fdb9d
commit b1b9aa3727
2 changed files with 53 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
const { ipcMain, shell } = require('electron');
function register({ crash, getMainWindow }) {
ipcMain.handle('crash:read', () => {
return crash.list();
});
ipcMain.on('crash:open-dir', () => {
shell.openPath(crash.path());
});
ipcMain.handle('crash:delete', (_event, filename) => {
if (typeof filename === 'string' && /^\d+(-\d+)?-(uncaughtException|unhandledRejection)\.json$/.test(filename)) {
crash.delete(filename);
return true;
}
return false;
});
}
module.exports = { register };