Linux: Fixes #3645: Prevent lock when restarting app

pull/3743/head
Laurent Cozic 2020-08-29 11:27:13 +01:00
parent 085109288f
commit 815775ad8f
1 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const { _, setLocale } = require('lib/locale.js');
const { shim } = require('lib/shim');
const { dirname, toSystemSlashes } = require('lib/path-utils.js');
const { BrowserWindow, nativeTheme } = require('electron');
@ -183,11 +184,17 @@ class Bridge {
}
restart() {
const { app } = require('electron');
// Note that in this case we are not sending the "appClose" event
// to notify services and component that the app is about to close
// but for the current use-case it's not really needed.
const { app } = require('electron');
app.relaunch();
if (shim.isLinux()) {
this.showInfoMessageBox(_('The app is now going to close. Please relaunch it to complete the process.'));
} else {
app.relaunch();
}
app.exit();
}