1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ElectronClient/gui/MainScreen/commands/newTodo.ts

23 lines
609 B
TypeScript
Raw Normal View History

import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
import { _ } from 'lib/locale';
export const declaration:CommandDeclaration = {
name: 'newTodo',
label: () => _('New to-do'),
iconName: 'fa-check-square',
};
export const runtime = ():CommandRuntime => {
return {
execute: async ({ template }:any) => {
return CommandService.instance().execute('newNote', { template: template, isTodo: true });
},
isEnabled: () => {
return CommandService.instance().isEnabled('newNote', {});
},
title: () => {
return _('New to-do');
},
};
};