[gnome-contacts/armonge/gnome-contacts-wip/fix-show-contact-option] app: Fixes show_individual when store is not ready




commit 7d4829c2da7b23b31700ac8bb4b68b5494540383
Author: Andres Reyes Monge <andres.reyes@vui.agency>
Date:   Wed Oct 21 15:21:06 2020 +0200

    app: Fixes show_individual when store is not ready

 src/contacts-app.vala | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index b93f92b6..082449ad 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -88,6 +88,16 @@ public class Contacts.App : Gtk.Application {
   }
 
   public async void show_individual (string id) {
+    if (contacts_store.is_quiescent) {
+      show_individual_ready.begin (id);
+    } else {
+      contacts_store.quiescent.connect( () => {
+        show_individual_ready.begin (id);
+      });
+    }
+  }
+
+  private async void show_individual_ready (string id) {
     Individual? contact = null;
     try {
       contact = yield contacts_store.aggregator.look_up_individual (id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]