Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed May 20, 2024
1 parent e0478fb commit ecd437c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions errands/widgets/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def __build_ui(self):
def __build_toolbar(self) -> None:
"""
Separate func for building toolbar.
Needed for lazy loading of the widget.
Needed for lazy loading of the toolbar.
If toolbar doesn't need to be shown on startup - don't load it.
It's saves memory. About 50 Mb for each 100 Tasks.
"""
Expand All @@ -373,8 +373,8 @@ def __build_toolbar(self) -> None:
def __load_sub_tasks(self) -> None:
tasks: list[TaskData] = (
t
for t in UserData.get_tasks_as_dicts(self.list_uid, self.uid)
if not t.deleted
for t in UserData.tasks
if not t.deleted and t.list_uid == self.list_uid and t.parent == self.uid
)
for task in tasks:
new_task = Task(task, self)
Expand Down Expand Up @@ -728,7 +728,7 @@ def _on_edit_row_applied(self, entry: Adw.EntryRow) -> None:
if not text or text == self.task_data.text:
return
self.update_props(["text", "synced"], [text, False])
self.update_ui()
self.update_title()
Sync.sync()

def _on_cancel_edit_btn_clicked(self, _btn: Gtk.Button) -> None:
Expand Down

0 comments on commit ecd437c

Please sign in to comment.