2020-07-03 23:32:39 +02:00
|
|
|
import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
|
2020-10-09 19:35:46 +02:00
|
|
|
import { _ } from 'lib/locale';
|
2020-07-03 23:32:39 +02:00
|
|
|
|
|
|
|
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: () => {
|
2020-10-09 19:35:46 +02:00
|
|
|
return CommandService.instance().isEnabled('newNote', {});
|
2020-07-03 23:32:39 +02:00
|
|
|
},
|
2020-07-04 11:33:04 +02:00
|
|
|
title: () => {
|
|
|
|
return _('New to-do');
|
|
|
|
},
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
};
|