From 1b6dffb88640f1624c3a905dc520883fda5be082 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 12 Jul 2016 03:23:47 -0400 Subject: [PATCH] Don't refresh collections pane when updating library last-sync times --- chrome/content/zotero/xpcom/data/feed.js | 4 +++- chrome/content/zotero/xpcom/data/group.js | 4 +++- chrome/content/zotero/xpcom/data/library.js | 2 +- chrome/content/zotero/xpcom/sync/syncEngine.js | 13 ++++++++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/feed.js b/chrome/content/zotero/xpcom/data/feed.js index 2b9588bec8..509b77e7c8 100644 --- a/chrome/content/zotero/xpcom/data/feed.js +++ b/chrome/content/zotero/xpcom/data/feed.js @@ -280,7 +280,9 @@ Zotero.Feed.prototype._saveData = Zotero.Promise.coroutine(function* (env) { params.push(this.libraryID); yield Zotero.DB.queryAsync(sql, params); - Zotero.Notifier.queue('modify', 'feed', this.libraryID, env.options.notifierQueue); + if (!env.options.skipNotifier) { + Zotero.Notifier.queue('modify', 'feed', this.libraryID, env.options.notifierQueue); + } } else { Zotero.debug("Feed data did not change for feed " + this.libraryID, 5); diff --git a/chrome/content/zotero/xpcom/data/group.js b/chrome/content/zotero/xpcom/data/group.js index e3e19dad32..5755502619 100644 --- a/chrome/content/zotero/xpcom/data/group.js +++ b/chrome/content/zotero/xpcom/data/group.js @@ -204,7 +204,9 @@ Zotero.Group.prototype._saveData = Zotero.Promise.coroutine(function* (env) { params.push(this.groupID); yield Zotero.DB.queryAsync(sql, params); - Zotero.Notifier.queue('modify', 'group', this.groupID); + if (!env.options.skipNotifier) { + Zotero.Notifier.queue('modify', 'group', this.groupID); + } } else { Zotero.debug("Group data did not change for group " + this.groupID, 5); diff --git a/chrome/content/zotero/xpcom/data/library.js b/chrome/content/zotero/xpcom/data/library.js index 18cbf9425e..ae451cb75b 100644 --- a/chrome/content/zotero/xpcom/data/library.js +++ b/chrome/content/zotero/xpcom/data/library.js @@ -520,7 +520,7 @@ Zotero.Library.prototype._saveData = Zotero.Promise.coroutine(function* (env) { // Since these are Zotero.Library properties, the 'modify' for the inheriting object may not // get triggered, so call it here too - if (this.libraryType != 'user') { + if (!env.options.skipNotifier && this.libraryType != 'user') { Zotero.Notifier.queue('modify', this.libraryType, this.libraryTypeID); } } else { diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js index 3077c8fb0e..b753220212 100644 --- a/chrome/content/zotero/xpcom/sync/syncEngine.js +++ b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -166,7 +166,10 @@ Zotero.Sync.Data.Engine.prototype.start = Zotero.Promise.coroutine(function* () } } - yield Zotero.Libraries.updateLastSyncTime(this.libraryID); + this.library.updateLastSyncTime(); + yield this.library.saveTx({ + skipNotifier: true + }); Zotero.debug("Done syncing " + this.library.name); }); @@ -850,7 +853,9 @@ Zotero.Sync.Data.Engine.prototype._uploadSettings = Zotero.Promise.coroutine(fun libraryVersion ); this.library.libraryVersion = libraryVersion; - yield this.library.saveTx(); + yield this.library.saveTx({ + skipNotifier: true + }); Zotero.debug("Done uploading settings in " + this.library.name); return libraryVersion; @@ -1053,7 +1058,9 @@ Zotero.Sync.Data.Engine.prototype._uploadDeletions = Zotero.Promise.coroutine(fu // Update library version this.library.libraryVersion = libraryVersion; - yield this.library.saveTx(); + yield this.library.saveTx({ + skipNotifier: true + }); // Remove successful deletions from delete log yield Zotero.Sync.Data.Local.removeObjectsFromDeleteLog(