diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index f41626a86..c968bbd99 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -490,7 +490,12 @@ Zotero.CollectionTreeView.prototype.notify = Zotero.Promise.coroutine(function* + "together in collectionTreeView::notify()") } yield this.reload(); - yield this.selectByID(selectRow ? "L" + id : currentTreeRow.id); + yield this.selectByID( + // Groups only come from sync, so they should never be auto-selected + (type != 'group' && selectRow) + ? "L" + id + : currentTreeRow.id + ); break; } } diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js index c4473047b..8ad35e803 100644 --- a/chrome/content/zotero/xpcom/sync/syncRunner.js +++ b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -527,9 +527,7 @@ Zotero.Sync.Runner_Module = function (options = {}) { group.version = info.version; group.archived = false; group.fromJSON(info.data, Zotero.Users.getCurrentUserID()); - yield group.saveTx({ - skipSelect: true - }); + yield group.saveTx(); // Add group to library list libraries.push(group.libraryID); diff --git a/test/content/support.js b/test/content/support.js index 49ff9e007..002e62df6 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -354,7 +354,7 @@ var createFeed = Zotero.Promise.coroutine(function* (props = {}) { feed.refreshInterval = props.refreshInterval || 12; feed.cleanupReadAfter = props.cleanupReadAfter || 2; feed.cleanupUnreadAfter = props.cleanupUnreadAfter || 30; - yield feed.saveTx(); + yield feed.saveTx(props.saveOptions); return feed; }); diff --git a/test/tests/collectionTreeViewTest.js b/test/tests/collectionTreeViewTest.js index 0a6814889..7ba275c2d 100644 --- a/test/tests/collectionTreeViewTest.js +++ b/test/tests/collectionTreeViewTest.js @@ -451,9 +451,19 @@ describe("Zotero.CollectionTreeView", function() { it("should select a new feed", function* () { var feed = yield createFeed(); - // Library should still be selected + // Feed should be selected assert.equal(cv.getSelectedLibraryID(), feed.id); - }) + }); + + it("shouldn't select a new feed with skipSelect: true", function* () { + var feed = yield createFeed({ + saveOptions: { + skipSelect: true + } + }); + // Library should still be selected + assert.equal(cv.getSelectedLibraryID(), userLibraryID); + }); it("should remove deleted feed", function* () { var feed = yield createFeed();