Bug 681356 - Don't show throbber after network error on sync (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 23 Aug 2011 17:03:03 -0400
changeset 75754 ed2e6e93a0de
parent 75753 a0d3c755b289
child 75755 87a72f57507e
push id1436
push userbzbarsky@mozilla.com
push date2011-08-23 21:03 +0000
treeherdermozilla-inbound@87a72f57507e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs681356
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 681356 - Don't show throbber after network error on sync (r=mfinkle) Notify remotetabs-list that a network error ocurred so that the 'loading' ui (i.e. the throbber) is hidden accordingly. Otherwise the user will get the impression that something is still happening after the error is shown.
mobile/chrome/content/bindings.xml
mobile/chrome/content/sync.js
--- a/mobile/chrome/content/bindings.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -1393,16 +1393,17 @@
           this.removeAttribute("message");
 
           if (Weave.Service.isLoggedIn) {
             setTimeout(function() self._loadChildren(), 0);
           } else {
             // Wait until login or setup finishes before loading items.
             let topics = [
               "browser:sync:setup:userabort",
+              "browser:sync:setup:networkerror",
               "weave:service:login:finish",
               "weave:service:login:error"
             ];
             function observe() {
               topics.forEach(function(topic) Services.obs.removeObserver(observe, topic, false));
               self._loadChildren();
             }
             topics.forEach(function(topic) Services.obs.addObserver(observe, topic, false));
--- a/mobile/chrome/content/sync.js
+++ b/mobile/chrome/content/sync.js
@@ -92,16 +92,17 @@ let WeaveGlue = {
   open: function open() {
     let container = document.getElementById("syncsetup-container");
     if (!container.hidden)
       return;
 
     // Services.io.offline is lying to us, so we use the NetworkLinkService instead
     let nls = Cc["@mozilla.org/network/network-link-service;1"].getService(Ci.nsINetworkLinkService);
     if (!nls.isLinkUp) {
+      Services.obs.notifyObservers(null, "browser:sync:setup:networkerror", "");
       Services.prompt.alert(window,
                              this._bundle.GetStringFromName("sync.setup.error.title"),
                              this._bundle.GetStringFromName("sync.setup.error.network"));
       return;
     }
 
     // Clear up any previous JPAKE codes
     this.abortEasySetup();