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 {
|
2023-06-30 10:11:26 +02:00
|
|
|
execute: async (_context: CommandContext, body = '') => {
|
2021-08-06 11:58:32 +02:00
|
|
|
return CommandService.instance().execute('newNote', body, true);
|
2020-07-04 11:33:04 +02:00
|
|
|
},
|
2023-07-16 18:42:42 +02:00
|
|
|
enabledCondition: 'oneFolderSelected && !inConflictFolder && !folderIsReadOnly',
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
};
|