Skip to content

Commit 862acf5

Browse files
authored
remove show event (#2023)
1 parent 452c597 commit 862acf5

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

core/Objects/Item.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,12 +1519,11 @@ public class Objects.Item : Objects.BaseObject {
15191519
}
15201520

15211521
public void move (Objects.Project project, string _section_id) {
1522-
loading = true;
1523-
show_item = false;
1524-
15251522
if (project.source_type == SourceType.LOCAL) {
15261523
_move (project.id, _section_id);
15271524
} else if (project.source_type == SourceType.TODOIST) {
1525+
loading = true;
1526+
15281527
string move_id = project.id;
15291528
string move_type = "project_id";
15301529
if (_section_id != "") {
@@ -1535,7 +1534,6 @@ public class Objects.Item : Objects.BaseObject {
15351534
Services.Todoist.get_default ().move_item.begin (this, move_type, move_id, (obj, res) => {
15361535
var response = Services.Todoist.get_default ().move_item.end (res);
15371536
loading = false;
1538-
show_item = true;
15391537

15401538
if (response.status) {
15411539
_move (project.id, _section_id);
@@ -1544,6 +1542,8 @@ public class Objects.Item : Objects.BaseObject {
15441542
}
15451543
});
15461544
} else if (project.source_type == SourceType.CALDAV) {
1545+
loading = true;
1546+
15471547
move_caldav_recursive.begin (project, _section_id);
15481548
}
15491549
}

src/Views/Today.vala

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -326,29 +326,21 @@ public class Views.Today : Adw.Bin {
326326
signal_map[Services.Store.instance ().item_archived.connect (valid_delete_item)] = Services.Store.instance ();
327327
signal_map[Services.Store.instance ().item_unarchived.connect (valid_add_item)] = Services.Store.instance ();
328328

329-
signal_map[Services.EventBus.get_default ().item_moved.connect ((item) => {
330-
// Handle existing items that may no longer belong in Today view
329+
signal_map[Services.EventBus.get_default ().item_moved.connect ((item, old_project_id, old_section_id, old_parent_id) => {
331330
if (items.has_key (item.id)) {
332-
if (Services.Store.instance ().valid_item_by_date (item, date, false)) {
333-
items[item.id].update_request ();
334-
} else {
335-
// Remove item that no longer belongs in today
331+
if (!Services.Store.instance ().valid_item_by_date (item, date, false)) {
336332
items[item.id].hide_destroy ();
337333
items.unset (item.id);
338334
}
339335
}
340336

341337
if (overdue_items.has_key (item.id)) {
342-
if (Services.Store.instance ().valid_item_by_overdue (item, date, false)) {
343-
overdue_items[item.id].update_request ();
344-
} else {
345-
// Remove item that no longer belongs in overdue
338+
if (!Services.Store.instance ().valid_item_by_overdue (item, date, false)) {
346339
overdue_items[item.id].hide_destroy ();
347340
overdue_items.unset (item.id);
348341
}
349342
}
350343

351-
// Check if item should be added to Today view (wasn't there before but should be now)
352344
if (!items.has_key (item.id) &&
353345
Services.Store.instance ().valid_item_by_date (item, date, false)) {
354346
add_item (item);
@@ -359,7 +351,6 @@ public class Views.Today : Adw.Bin {
359351
add_overdue_item (item);
360352
}
361353

362-
// Update UI state
363354
update_headers ();
364355
check_placeholder ();
365356
listbox.invalidate_filter ();
@@ -542,7 +533,7 @@ public class Views.Today : Adw.Bin {
542533
overdue_listbox.invalidate_filter ();
543534
}
544535

545-
private void valid_update_item (Objects.Item item) {
536+
private void valid_update_item (Objects.Item item, string update_id) {
546537
if (items.has_key (item.id)) {
547538
items[item.id].update_request ();
548539
}

0 commit comments

Comments
 (0)