fix: recover after crash

This commit is contained in:
ThaUnknown 2022-07-05 13:19:42 +02:00
parent 6db7491481
commit 67b44cdff0
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Miru",
"version": "2.7.3",
"version": "2.7.4",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"main": "src/index.js",
"homepage": "https://github.com/ThaUnknown/miru#readme",

View file

@ -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', () => {