www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 222bb5bad4d2b422d8f4791ee31e87492d5b01ee
parent 7d424f6d12a03c906fab4e58c975cd6c38f98682
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  6 Apr 2018 04:27:58 -0400

Target selector: Don't lose recent targets when saving to same target

A target could fill up the list from different sessions, pushing other
recents out.

Diffstat:
Mchrome/content/zotero/xpcom/server_connector.js | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js @@ -263,10 +263,13 @@ Zotero.Server.Connector.SaveSession.prototype._updateRecents = function () { } // Otherwise add this target to the end if (!sessionFound) { - recents.push({ - id: targetID, - sessionID: this.id - }); + recents + // Remove this target from the list if it's there from another session + .filter(r => r.id != targetID) + .concat({ + id: targetID, + sessionID: this.id + }); } recents = recents.slice(-1 * numRecents); Zotero.Prefs.set('recentSaveTargets', JSON.stringify(recents));