about summary refs log tree commit diff
path: root/src/ui/task_details.rs
diff options
context:
space:
mode:
authorRicky Kresslein <rk@lakoliu.com>2022-04-24 11:04:59 +0300
committerRicky Kresslein <rk@lakoliu.com>2022-04-24 11:06:59 +0300
commit794cf5b7025d72b9a2b61fc6f5df753363d6060a (patch)
treeee2717da54206b0211e23072a5b30ded7776b02d /src/ui/task_details.rs
parentc2e3648baca0756cb4f9fd5ada5ab312d0909dc2 (diff)
downloadFurtherance-794cf5b7025d72b9a2b61fc6f5df753363d6060a.tar.zst
Bug fix: task now removed from group when name or tags changed
Diffstat (limited to 'src/ui/task_details.rs')
-rwxr-xr-xsrc/ui/task_details.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/task_details.rs b/src/ui/task_details.rs
index be75206..9bb98b3 100755
--- a/src/ui/task_details.rs
+++ b/src/ui/task_details.rs
@@ -112,7 +112,7 @@ impl FurTaskDetails {
         imp.task_name_label.set_text(&task_group[0].task_name);
         let this_day_str = DateTime::parse_from_rfc3339(&task_group[0].start_time).unwrap();
         *imp.this_day.borrow_mut() = this_day_str.format("%h %d %Y").to_string();
-        *imp.orig_tags.borrow_mut() = task_group[0].task_name.clone();
+        *imp.orig_tags.borrow_mut() = task_group[0].tags.clone();
 
         for task in task_group.clone() {
             imp.all_task_ids.borrow_mut().push(task.id);
@@ -435,7 +435,9 @@ impl FurTaskDetails {
             let delete = {
                 let start_time = DateTime::parse_from_rfc3339(&task.start_time).unwrap();
                 let start_time_str = start_time.format("%h %d %Y").to_string();
-                if imp.this_day.borrow().to_string() != start_time_str {
+                if imp.this_day.borrow().to_string() != start_time_str
+                    || imp.task_name_label.text() != task.task_name
+                    || imp.orig_tags.borrow().to_string() != task.tags {
                     false
                 } else {
                     true
@@ -443,8 +445,6 @@ impl FurTaskDetails {
             };
             delete
         });
-        // TODO Need to check if all task names and tags also match the original
-        // and remove those that don't.
 
         imp.all_task_ids.borrow_mut().clear();
         let window = FurtheranceWindow::default();