Bug 840643 - Fix exception in WeaveGlue.init that breaks Metro sync setup [r=ally]

This commit is contained in:
Matt Brubeck 2013-02-26 06:58:38 -08:00
parent fd2a3d3551
commit 4668093091

View File

@ -24,15 +24,10 @@ let WeaveGlue = {
if (service.ready) {
this._init();
return;
} else {
Services.obs.addObserver(this, "weave:service:ready", false);
service.ensureLoaded();
}
Services.obs.addObserver(function onReady() {
Services.obs.removeObserver(onReady, "weave:service:ready");
this._init();
}.bind(this), "weave:service:ready", false);
service.ensureLoaded();
},
_init: function () {
@ -425,6 +420,12 @@ let WeaveGlue = {
},
observe: function observe(aSubject, aTopic, aData) {
if (aTopic == "weave:service:ready") {
Services.obs.removeObserver(this, aTopic);
this._init();
return;
}
// Make sure we're online when connecting/syncing
Util.forceOnline();