Fix uncaught exception in logging

This commit is contained in:
Fedor Indutny 2022-05-25 11:04:01 -07:00 committed by GitHub
parent 80c90540f6
commit bf6d9c6cda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,6 +111,7 @@ export async function initialize(
timestamp: pino.stdTimeFunctions.isoTime,
});
ipc.removeHandler('fetch-log');
ipc.handle('fetch-log', async () => {
const mainWindow = getMainWindow();
if (!mainWindow) {
@ -137,6 +138,7 @@ export async function initialize(
return data;
});
ipc.removeHandler('delete-all-logs');
ipc.handle('delete-all-logs', async () => {
// Restart logging when the streams will close
shouldRestart = true;