2020-11-07 17:59:37 +02:00
|
|
|
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
|
2020-10-25 19:22:59 +02:00
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
export const declaration: CommandDeclaration = {
|
2020-10-25 19:22:59 +02:00
|
|
|
name: 'openFolder',
|
|
|
|
};
|
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
export const runtime = (): CommandRuntime => {
|
2020-10-25 19:22:59 +02:00
|
|
|
return {
|
2020-11-12 21:13:28 +02:00
|
|
|
execute: async (context: CommandContext, folderId: string) => {
|
2020-10-25 19:22:59 +02:00
|
|
|
context.dispatch({
|
|
|
|
type: 'FOLDER_SELECT',
|
|
|
|
id: folderId,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|