diff --git a/chrome/content/zotero/xpcom/data/library.js b/chrome/content/zotero/xpcom/data/library.js index 5646abc738..70c67242af 100644 --- a/chrome/content/zotero/xpcom/data/library.js +++ b/chrome/content/zotero/xpcom/data/library.js @@ -147,6 +147,12 @@ Zotero.defineProperty(Zotero.Library.prototype, 'libraryTypeID', { } }); +Zotero.defineProperty(Zotero.Library.prototype, 'isGroup', { + get: function () { + return this.libraryType == 'group'; + } +}); + Zotero.defineProperty(Zotero.Library.prototype, 'libraryVersion', { get: function() { return this._get('_libraryVersion'); }, set: function(v) { return this._set('_libraryVersion', v); } diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js index c7ae8d738b..6414148c03 100644 --- a/chrome/content/zotero/xpcom/data/search.js +++ b/chrome/content/zotero/xpcom/data/search.js @@ -247,12 +247,6 @@ Zotero.Search.prototype._finalizeSave = Zotero.Promise.coroutine(function* (env) Zotero.Notifier.queue('modify', 'search', this.id, env.notifierData, env.options.notifierQueue); } - if (env.isNew && Zotero.Libraries.isGroupLibrary(this.libraryID)) { - var groupID = Zotero.Groups.getGroupIDFromLibraryID(this.libraryID); - var group = yield Zotero.Groups.get(groupID); - group.clearSearchCache(); - } - if (!env.skipCache) { yield this.reload(); // If new, there's no other data we don't have, so we can mark everything as loaded diff --git a/test/tests/librariesTest.js b/test/tests/librariesTest.js index ba2da772af..f27176967e 100644 --- a/test/tests/librariesTest.js +++ b/test/tests/librariesTest.js @@ -187,9 +187,11 @@ describe("Zotero.Libraries", function() { assert.isFalse(Zotero.Libraries.isGroupLibrary(id), "returns false for " + type + " library"); } }); - if("should return true for group library", function(){ + + it("should return true for group library", function () { assert.isTrue(Zotero.Libraries.isGroupLibrary(group.libraryID)); }) + it("should throw for invalid library ID", function() { assert.throws(Zotero.Libraries.isGroupLibrary.bind(Zotero.Libraries, -1), /^Invalid library ID /); });