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.
This commit is contained in:
parent
7d424f6d12
commit
222bb5bad4
|
@ -263,10 +263,13 @@ Zotero.Server.Connector.SaveSession.prototype._updateRecents = function () {
|
||||||
}
|
}
|
||||||
// Otherwise add this target to the end
|
// Otherwise add this target to the end
|
||||||
if (!sessionFound) {
|
if (!sessionFound) {
|
||||||
recents.push({
|
recents
|
||||||
id: targetID,
|
// Remove this target from the list if it's there from another session
|
||||||
sessionID: this.id
|
.filter(r => r.id != targetID)
|
||||||
});
|
.concat({
|
||||||
|
id: targetID,
|
||||||
|
sessionID: this.id
|
||||||
|
});
|
||||||
}
|
}
|
||||||
recents = recents.slice(-1 * numRecents);
|
recents = recents.slice(-1 * numRecents);
|
||||||
Zotero.Prefs.set('recentSaveTargets', JSON.stringify(recents));
|
Zotero.Prefs.set('recentSaveTargets', JSON.stringify(recents));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user