From 67b44cdff000eadd1c1ea91a339627dc14205b87 Mon Sep 17 00:00:00 2001 From: ThaUnknown <6506529+ThaUnknown@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:19:42 +0200 Subject: [PATCH] fix: recover after crash --- package.json | 2 +- src/index.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 12c99f4..fde6dad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Miru", - "version": "2.7.3", + "version": "2.7.4", "author": "ThaUnknown_ ", "main": "src/index.js", "homepage": "https://github.com/ThaUnknown/miru#readme", diff --git a/src/index.js b/src/index.js index 7b63a8d..24cf402 100644 --- a/src/index.js +++ b/src/index.js @@ -118,6 +118,13 @@ function createWindow () { mainWindow = null }) + mainWindow.webContents.on('render-process-gone', (e, { reason }) => { + if (reason === 'crashed') { + app.relaunch() + app.quit() + } + }) + // Emitted when the window is ready to be shown // This helps in showing the window gracefully. mainWindow.once('ready-to-show', () => {