Bug 1416321 - Do a sync after we successfully connect to a captive portal. r=markh

MozReview-Commit-ID: HuXyJ8IrNwA

--HG--
extra : rebase_source : b1171a1235011d5393dcd90a950b55320302c254
This commit is contained in:
Edouard Oger 2017-11-10 14:55:19 -05:00
parent 99648703bd
commit 8a3dc70885

View File

@ -134,6 +134,7 @@ SyncScheduler.prototype = {
if (Status.checkSetup() == STATUS_OK) {
Svc.Obs.add("wake_notification", this);
Svc.Obs.add("captive-portal-login-success", this);
IdleService.addIdleObserver(this, Svc.Prefs.get("scheduler.idleTime"));
}
},
@ -275,6 +276,7 @@ SyncScheduler.prototype = {
Services.prefs.savePrefFile(null);
IdleService.addIdleObserver(this, Svc.Prefs.get("scheduler.idleTime"));
Svc.Obs.add("wake_notification", this);
Svc.Obs.add("captive-portal-login-success", this);
break;
case "weave:service:start-over":
this.setDefaults();
@ -324,6 +326,12 @@ SyncScheduler.prototype = {
}
});
break;
case "captive-portal-login-success":
this._log.debug("Captive portal login success. Scheduling a sync.");
CommonUtils.nextTick(() => {
this.scheduleNextSync(3000);
});
break;
}
},