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