kusold / todoist-habitrpg

One way sync from Todoist -> HabitRPG
120 stars 14 forks source link

Slight Problem with Dailies #21

Closed crookedneighbor closed 9 years ago

crookedneighbor commented 9 years ago

Just discovered that if you edit a completed task that is synced as Daily on Habit, it'll uncheck it on Habit. Here's what I did:

  1. Marked task as complete on Todoist, synced to Habit
  2. Decided to add a label to task in Todoist
  3. Todoist-Habitrpg saw that the task had been updated and synced it to Habit, including the new unchecked status.

@Kusold Do you have ideas for how to handle this?

crookedneighbor commented 9 years ago

I think adding this at line 188 of habitSync.js would do it:

else if(item.habitrpg.completed) {
    task.completed = true;
}

IE, if the date hasn't changed, but the daily still needs to be updated and it was checked before, keep it checked.