mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
25 lines
552 B
JavaScript
25 lines
552 B
JavaScript
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 };
|