Bug 1212675 - have about:sync-tabs reload the new set of tabs after sync completes. r=adw

This commit is contained in:
Mark Hammond 2015-10-12 14:04:02 +11:00
Родитель d62f1d47f9
Коммит 89fd15e57d
1 изменённых файлов: 10 добавлений и 4 удалений

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

@ -159,7 +159,7 @@ var RemoteTabViewer = {
_buildListRequested: false,
buildList: function (force) {
buildList: function (forceSync) {
if (this._waitingForBuildList) {
this._buildListRequested = true;
return;
@ -170,14 +170,15 @@ var RemoteTabViewer = {
this._clearTabList();
if (Weave.Service.isLoggedIn && this._refetchTabs(force)) {
if (Weave.Service.isLoggedIn) {
this._refetchTabs(forceSync);
this._generateWeaveTabList();
} else {
//XXXzpao We should say something about not being logged in & not having data
// or tell the appropriate condition. (bug 583344)
}
function complete() {
let complete = () => {
this._waitingForBuildList = false;
if (this._buildListRequested) {
CommonUtils.nextTick(this.buildList, this);
@ -335,10 +336,15 @@ var RemoteTabViewer = {
observe: function (subject, topic, data) {
switch (topic) {
case "weave:service:login:finish":
// A login has finished, which means that a Sync is about to start and
// we will eventually get to the "tabs" engine - but try and force the
// tab engine to sync first by passing |true| for the forceSync param.
this.buildList(true);
break;
case "weave:engine:sync:finish":
if (subject == "tabs") {
if (data == "tabs") {
// The tabs engine just finished, so re-build the list without
// forcing a new sync of the tabs engine.
this.buildList(false);
}
break;