1
0
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:
Laurent Cozic 2022-04-17 12:26:58 +01:00
parent fd9fe5c931
commit 1797e847aa
3 changed files with 4 additions and 4 deletions

View File

@ -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();

View File

@ -20,7 +20,7 @@ export const runtime = (): CommandRuntime => {
};
await saveProfileConfig(`${Setting.value('rootProfileDir')}/profiles.json`, newConfig);
bridge().restart();
bridge().restart(false);
},
};
};

View File

@ -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 });