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

23 lines
610 B
TypeScript
Raw Normal View History

import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
const { _ } = require('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');
},
};
};