fix: handle deleted tasks in todo-sync (Cubic feedback)
- When task is deleted (syncTaskToTodo returns null), filter by content - Prevents stale todos from remaining after task deletion
This commit is contained in:
@@ -108,7 +108,11 @@ export async function syncTaskTodoUpdate(
|
||||
});
|
||||
const currentTodos = extractTodos(response);
|
||||
const taskTodo = syncTaskToTodo(task);
|
||||
const nextTodos = currentTodos.filter((todo) => !taskTodo || !todosMatch(todo, taskTodo));
|
||||
const nextTodos = currentTodos.filter((todo) =>
|
||||
taskTodo
|
||||
? !todosMatch(todo, taskTodo)
|
||||
: todo.content !== task.subject
|
||||
);
|
||||
const todo = taskTodo;
|
||||
|
||||
if (todo) {
|
||||
|
||||
Reference in New Issue
Block a user