1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Add support for multiple instances (#11963)

This commit is contained in:
Laurent Cozic
2025-03-16 10:18:32 +00:00
committed by GitHub
parent 7b2b3a4f80
commit cb5ffd968d
32 changed files with 757 additions and 60 deletions

View File

@@ -687,7 +687,9 @@ export default class BaseApplication {
// https://immerjs.github.io/immer/docs/freezing
setAutoFreeze(initArgs.env === 'dev');
const { rootProfileDir, homeDir } = determineProfileAndBaseDir(options.rootProfileDir ?? initArgs.profileDir, appName);
const altInstanceId = initArgs.altInstanceId || '';
const { rootProfileDir, homeDir } = determineProfileAndBaseDir(options.rootProfileDir ?? initArgs.profileDir, appName, altInstanceId);
const { profileDir, profileConfig, isSubProfile } = await initProfile(rootProfileDir);
this.profileConfig_ = profileConfig;
@@ -781,6 +783,8 @@ export default class BaseApplication {
Setting.setValue('isSafeMode', true);
}
Setting.setValue('altInstanceId', altInstanceId);
const safeModeFlagFile = join(profileDir, safeModeFlagFilename);
if (await fs.pathExists(safeModeFlagFile) && fs.readFileSync(safeModeFlagFile, 'utf8') === 'true') {
appLogger.info(`Safe mode enabled because of file: ${safeModeFlagFile}`);