From d530d9cf95b625f9b1acf093f0e8cb6f7ba4a223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 29 Oct 2021 11:28:30 +0300 Subject: [PATCH] Fix collection open state persistance. Closes #2228 --- chrome/content/zotero/collectionTree.jsx | 6 +++--- chrome/content/zotero/zoteroPane.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/collectionTree.jsx b/chrome/content/zotero/collectionTree.jsx index a0fb6f3eb4..6075aa211d 100644 --- a/chrome/content/zotero/collectionTree.jsx +++ b/chrome/content/zotero/collectionTree.jsx @@ -2092,7 +2092,7 @@ var CollectionTree = class CollectionTree extends LibraryTree { /** * Persist the current open/closed state of rows to a pref */ - _saveOpenStates = Zotero.Utilities.debounce(async function() { + _saveOpenStates = async function() { var state = this._containerState; // Every so often, remove obsolete rows @@ -2134,8 +2134,8 @@ var CollectionTree = class CollectionTree extends LibraryTree { } this._containerState = state; - this._storeOpenStates = state; - }); + this._storeOpenStates(state); + }; _storeOpenStates = Zotero.Utilities.debounce(function(state) { Zotero.Prefs.set("sourceList.persist", JSON.stringify(state)); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 41bda76153..af183c22d8 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1219,7 +1219,7 @@ var ZoteroPane = new function() } if (this.itemsView && this.itemsView.collectionTreeRow && this.itemsView.collectionTreeRow.id == collectionTreeRow.id) { - Zotero.debug("Collection selection hasn't changed"); + Zotero.debug("ZoteroPane.onCollectionSelected: Collection selection hasn't changed"); // Update toolbar, in case editability has changed this._updateToolbarIconsForRow(collectionTreeRow);