зеркало из https://github.com/mozilla/gecko-dev.git
Bug 526942 - Try to sync tabs when viewing remote tabs
Try fetching tabs when loading the remote tabs view and if the sync got new tabs, reload the page.
This commit is contained in:
Родитель
9a15bcc16b
Коммит
21aa4351a8
|
@ -410,6 +410,10 @@ SyncEngine.prototype = {
|
||||||
let count = {applied: 0, reconciled: 0};
|
let count = {applied: 0, reconciled: 0};
|
||||||
let handled = [];
|
let handled = [];
|
||||||
newitems.recordHandler = Utils.bind2(this, function(item) {
|
newitems.recordHandler = Utils.bind2(this, function(item) {
|
||||||
|
// Grab a later last modified if possible
|
||||||
|
if (this.lastModified == null || item.modified > this.lastModified)
|
||||||
|
this.lastModified = item.modified;
|
||||||
|
|
||||||
// Remember which records were processed
|
// Remember which records were processed
|
||||||
handled.push(item.id);
|
handled.push(item.id);
|
||||||
|
|
||||||
|
@ -432,7 +436,7 @@ SyncEngine.prototype = {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Only bother getting data from the server if there's new things
|
// Only bother getting data from the server if there's new things
|
||||||
if (this.lastModified > this.lastSync) {
|
if (this.lastModified == null || this.lastModified > this.lastSync) {
|
||||||
let resp = newitems.get();
|
let resp = newitems.get();
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
resp.failureCode = ENGINE_DOWNLOAD_FAIL;
|
resp.failureCode = ENGINE_DOWNLOAD_FAIL;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче