- super fun spinning throbber goodness!

This commit is contained in:
cbeard@h-135.office.mozilla.org 2007-09-25 16:33:23 -07:00
parent 2f70c2abff
commit 3e3e800025

View File

@ -601,6 +601,7 @@ BookmarksSyncService.prototype = {
var generator = yield; var generator = yield;
var handlers = this._handlersForGenerator(generator); var handlers = this._handlersForGenerator(generator);
this._os.notifyObservers(null, "bookmarks-sync:start", "");
LOG("Beginning sync"); LOG("Beginning sync");
try { try {
@ -620,9 +621,11 @@ BookmarksSyncService.prototype = {
LOG("server: " + uneval(server)); LOG("server: " + uneval(server));
if (server['status'] == 2) { if (server['status'] == 2) {
this._os.notifyObservers(null, "bookmarks-sync:end", "");
LOG("Sync complete"); LOG("Sync complete");
return; return;
} else if (server['status'] != 0 && server['status'] != 1) { } else if (server['status'] != 0 && server['status'] != 1) {
this._os.notifyObservers(null, "bookmarks-sync:end", "");
LOG("Sync error"); LOG("Sync error");
return; return;
} }
@ -636,6 +639,7 @@ BookmarksSyncService.prototype = {
var localUpdates = this._detectUpdates(this._snapshot, localJson); var localUpdates = this._detectUpdates(this._snapshot, localJson);
LOG("updates: " + uneval(localUpdates)); LOG("updates: " + uneval(localUpdates));
if (!(server['status'] == 1 || localUpdates.length > 0)) { if (!(server['status'] == 1 || localUpdates.length > 0)) {
this._os.notifyObservers(null, "bookmarks-sync:end", "");
LOG("Sync complete (1): no changes needed on client or server"); LOG("Sync complete (1): no changes needed on client or server");
return; return;
} }
@ -673,6 +677,7 @@ BookmarksSyncService.prototype = {
if (!(clientChanges.length || serverChanges.length || if (!(clientChanges.length || serverChanges.length ||
clientConflicts.length || serverConflicts.length)) { clientConflicts.length || serverConflicts.length)) {
this._os.notifyObservers(null, "bookmarks-sync:end", "");
LOG("Sync complete (2): no changes needed on client or server"); LOG("Sync complete (2): no changes needed on client or server");
this._snapshot = this._wrapNode(localBookmarks); this._snapshot = this._wrapNode(localBookmarks);
this._snapshotVersion = server['version']; this._snapshotVersion = server['version'];
@ -716,6 +721,7 @@ BookmarksSyncService.prototype = {
LOG("Error: could not update deltas on server"); LOG("Error: could not update deltas on server");
} }
} }
this._os.notifyObservers(null, "bookmarks-sync:end", "");
LOG("Sync complete"); LOG("Sync complete");
} finally { } finally {
//this._dav.unlock(handlers); //this._dav.unlock(handlers);