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
Родитель 487f6796a4
Коммит 0cde40a91f
1 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -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();