1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +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

@@ -1,5 +1,6 @@
import CommandService, { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
import { _ } from '@joplin/lib/locale';
import { profileIdByIndex } from '../../lib/services/profileConfig';
export const declaration: CommandDeclaration = {
name: 'switchProfile2',
@@ -8,8 +9,8 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext) => {
await CommandService.instance().execute('switchProfile', 1);
execute: async (context: CommandContext) => {
await CommandService.instance().execute('switchProfile', profileIdByIndex(context.state.profileConfig, 1));
},
};
};