[polari] userList: Keep previously fetched details around



commit fd8eca6c8d3b0f0391b0eef5225c55f01e9d405a
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Sep 21 16:50:04 2014 +0200

    userList: Keep previously fetched details around
    
    User details may have changed since the last time they were seen,
    so we should still update them when re-opening them. Still, the
    old info is more useful then the spinner, so only show the latter
    if there's no previously fetched information available, and keep
    showing the old details until the updated information is retrieved
    otherwise.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737136

 src/userList.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/userList.js b/src/userList.js
index e49c88a..79e0e44 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -239,6 +239,8 @@ const UserListRow = new Lang.Class({
         if (!fn)
             fn = this.widget.user.alias;
 
+        this._detailsGrid.foreach(function(w) { w.destroy(); });
+
         let row = 0;
         let w = new Gtk.Label({ label: fn, ellipsize: Pango.EllipsizeMode.END,
                                 halign: Gtk.Align.START });
@@ -288,11 +290,10 @@ const UserListRow = new Lang.Class({
             this.widget.get_style_context().add_class('expanded');
             this._arrow.arrow_type = Gtk.ArrowType.DOWN;
 
-            this._spinnerBox.show();
+            let prevDetails = this._detailsGrid.get_children().length > 0;
+            this._spinnerBox.visible = !prevDetails;
             this._spinner.start();
 
-            this._detailsGrid.foreach(function(w) { w.destroy(); });
-
             this._cancellable = new Gio.Cancellable();
             this.widget.user.request_contact_info_async(this._cancellable,
                                                         Lang.bind(this, this._onContactInfoReady));


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