Commit 3228f138 authored by ransome1's avatar ransome1
Browse files

Fixed recurrences bug

parent 622369e8
{
"name": "sleek",
"productName": "sleek",
"version": "1.2.4-rc.2",
"version": "1.2.4-rc.3",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"category": "ProjectManagement",
......
......@@ -80,8 +80,7 @@ function generateRecurrence(todo) {
const index = items.objects.map(function(item) {return item.toString().replaceAll(String.fromCharCode(16)," "); }).indexOf(recurringTodo.toString().replaceAll(String.fromCharCode(16)," "));
// only add recurring todo if it is not already in the list
if(index===-1) {
items.objects.push(recurringTodo);
window.api.send("writeToFile", [items.objects.join("\n").toString() + "\n"]);
window.api.send("writeToFile", [recurringTodo.toString(), index]);
return Promise.resolve("Success: Recurring todo created and written into file: " + getActiveFile());
} else {
return Promise.resolve("Info: Recurring todo already in file, won't write anything");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment