2020-11-07 17:59:37 +02:00
|
|
|
import CommandService, { CommandContext, CommandDeclaration, CommandRuntime } from '@joplin/lib/services/CommandService';
|
|
|
|
import { _ } from '@joplin/lib/locale';
|
2020-07-03 23:32:39 +02:00
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
export const declaration: CommandDeclaration = {
|
2020-07-03 23:32:39 +02:00
|
|
|
name: 'newTodo',
|
|
|
|
label: () => _('New to-do'),
|
|
|
|
iconName: 'fa-check-square',
|
|
|
|
};
|
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
export const runtime = (): CommandRuntime => {
|
2020-07-03 23:32:39 +02:00
|
|
|
return {
|
2021-08-06 11:58:32 +02:00
|
|
|
execute: async (_context: CommandContext, body: string = '') => {
|
|
|
|
return CommandService.instance().execute('newNote', body, true);
|
2020-07-04 11:33:04 +02:00
|
|
|
},
|
2020-10-18 22:52:10 +02:00
|
|
|
enabledCondition: 'oneFolderSelected && !inConflictFolder',
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
};
|