1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Multi-profiles: Assign an ID to profiles and remove path

This commit is contained in:
Laurent Cozic
2022-04-16 15:04:06 +01:00
parent 0cdef66816
commit b4a6e17090
11 changed files with 140 additions and 58 deletions

View File

@ -10,13 +10,13 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (context: CommandContext, profileIndex: number) => {
execute: async (context: CommandContext, profileId: string) => {
const currentConfig = context.state.profileConfig;
if (currentConfig.currentProfile === profileIndex) return;
if (currentConfig.currentProfileId === profileId) return;
const newConfig: ProfileConfig = {
...currentConfig,
currentProfile: profileIndex,
currentProfileId: profileId,
};
await saveProfileConfig(`${Setting.value('rootProfileDir')}/profiles.json`, newConfig);