1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

CLI: fixed todo toggle

This commit is contained in:
Laurent Cozic 2017-07-31 18:47:06 +00:00
parent 2882aef8e4
commit 4a7e8cdbaa
3 changed files with 7 additions and 8 deletions

View File

@ -35,8 +35,11 @@ class Command extends BaseCommand {
};
if (action == 'toggle') {
toSave.todo_completed = note.todo_completed ? 0 : time.unixMs();
if (!note.is_todo) toSave.is_todo = 1;
if (!note.is_todo) {
toSave = Note.toggleIsTodo(note);
} else {
toSave.todo_completed = note.todo_completed ? 0 : time.unixMs();
}
} else if (action == 'clear') {
toSave.is_todo = 0;
}

View File

@ -14,8 +14,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
msgid "No notebook selected."
msgstr "Aucun carnet n'est sélectionné."

View File

@ -272,10 +272,8 @@ class Note extends BaseItem {
let output = Object.assign({}, note);
output.is_todo = output.is_todo ? 0 : 1;
if (!output.is_todo) {
output.todo_due = 0;
output.todo_completed = 0;
}
output.todo_due = 0;
output.todo_completed = 0;
return output;
}