fix(trash & tags): fix subtasks hierarchy restoration in trash and real-time tag counts sync
Build and Push Docker Image / build-and-push (push) Successful in 9m16s
Build and Push Docker Image / build-and-push (push) Successful in 9m16s
This commit is contained in:
@@ -410,13 +410,13 @@ export function AppShell({ user, isDemo = false }: AppShellProps) {
|
||||
}
|
||||
};
|
||||
|
||||
// Restore from Trash
|
||||
// Restore from Trash (Restores task and all its nested subtasks)
|
||||
const handleRestoreTask = (id: string) => {
|
||||
if (isDemo) {
|
||||
const store = getDemoStore();
|
||||
const newTasks = restoreTaskInTree(store.tasks, id);
|
||||
saveDemoStore(store.lists, newTasks);
|
||||
setTasks((prev) => prev.filter((t) => t.id !== id));
|
||||
setTasks(getAllTrashTasks(newTasks) as Task[]);
|
||||
refresh();
|
||||
}
|
||||
};
|
||||
@@ -427,7 +427,7 @@ export function AppShell({ user, isDemo = false }: AppShellProps) {
|
||||
const store = getDemoStore();
|
||||
const newTasks = deleteTaskInTree(store.tasks, id);
|
||||
saveDemoStore(store.lists, newTasks);
|
||||
setTasks((prev) => prev.filter((t) => t.id !== id));
|
||||
setTasks(getAllTrashTasks(newTasks) as Task[]);
|
||||
refresh();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user