mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 10:21:06 +05:30
feat(ipc): add updater and crash IPC handlers
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user