fix (tasklist): More bugfixes.

Fix issue where save did not send all tasks.
Fix issue where tasklist update would also affect deleted tasks.
This commit is contained in:
2023-07-07 23:33:10 +03:00
parent 177eb288e8
commit 78fb398e03

View File

@@ -174,7 +174,10 @@ class Tasklist:
Update every task in the tasklist, regardless of cache.
"""
kwargs.setdefault('last_updated_at', utc_now())
tasks = await self.data.Task.table.update_where(userid=self.userid).set(**kwargs)
tasks = await self.data.Task.table.update_where(
userid=self.userid,
deleted_at=None
).set(**kwargs)
return tasks
@@ -286,8 +289,6 @@ class Tasklist:
prefix = ' ' * (len(label) - 1)
box = '- [ ]' if task.completed_at is None else '- [x]'
line = f"{prefix}{box} {task.content}"
if total_len + len(line) > 4000:
break
lines[task.taskid] = line
total_len += len(line)
return lines