mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-26 18:58:21 +02:00
Desktop: Fixed restarting portable app
This commit is contained in:
parent
77c7f966cf
commit
e190d90832
@ -1237,9 +1237,14 @@ class Application extends BaseApplication {
|
||||
this.updateMenuItemStates();
|
||||
|
||||
// Make it available to the console window - useful to call revisionService.collectRevisions()
|
||||
window.revisionService = RevisionService.instance();
|
||||
window.migrationService = MigrationService.instance();
|
||||
window.decryptionWorker = DecryptionWorker.instance();
|
||||
window.joplin = () => {
|
||||
return {
|
||||
revisionService: RevisionService.instance(),
|
||||
migrationService: MigrationService.instance(),
|
||||
decryptionWorker: DecryptionWorker.instance(),
|
||||
bridge: bridge(),
|
||||
};
|
||||
};
|
||||
|
||||
bridge().addEventListener('nativeThemeUpdated', this.bridge_nativeThemeUpdated);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
const { _, setLocale } = require('lib/locale.js');
|
||||
const { dirname, toSystemSlashes } = require('lib/path-utils.js');
|
||||
const { BrowserWindow, nativeTheme } = require('electron');
|
||||
const { shim } = require('lib/shim.js');
|
||||
|
||||
class Bridge {
|
||||
|
||||
@ -187,7 +188,16 @@ class Bridge {
|
||||
// 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.isPortable()) {
|
||||
const options = {
|
||||
execPath: process.env.PORTABLE_EXECUTABLE_FILE,
|
||||
};
|
||||
app.relaunch(options);
|
||||
} else {
|
||||
app.relaunch();
|
||||
}
|
||||
|
||||
app.exit();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user