mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
Desktop: Multi-profiles: Automatically restart the app when switching profiles on Linux
This commit is contained in:
parent
fd9fe5c931
commit
1797e847aa
@ -265,7 +265,7 @@ export class Bridge {
|
||||
}
|
||||
}
|
||||
|
||||
restart() {
|
||||
restart(linuxSafeRestart = true) {
|
||||
// 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.
|
||||
@ -276,7 +276,7 @@ export class Bridge {
|
||||
execPath: process.env.PORTABLE_EXECUTABLE_FILE,
|
||||
};
|
||||
app.relaunch(options);
|
||||
} else if (shim.isLinux()) {
|
||||
} else if (shim.isLinux() && linuxSafeRestart) {
|
||||
this.showInfoMessageBox(_('The app is now going to close. Please relaunch it to complete the process.'));
|
||||
} else {
|
||||
app.relaunch();
|
||||
|
@ -20,7 +20,7 @@ export const runtime = (): CommandRuntime => {
|
||||
};
|
||||
|
||||
await saveProfileConfig(`${Setting.value('rootProfileDir')}/profiles.json`, newConfig);
|
||||
bridge().restart();
|
||||
bridge().restart(false);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
||||
const { newConfig, newProfile } = createNewProfile(context.state.profileConfig, answer);
|
||||
newConfig.currentProfileId = newProfile.id;
|
||||
await saveProfileConfig(`${Setting.value('rootProfileDir')}/profiles.json`, newConfig);
|
||||
bridge().restart();
|
||||
bridge().restart(false);
|
||||
}
|
||||
|
||||
comp.setState({ promptOptions: null });
|
||||
|
Loading…
Reference in New Issue
Block a user