qf: show recently modified notes when empty input (#4797)

Fixes: #4771
This commit is contained in:
abaevbog 2024-11-06 05:38:05 -08:00 committed by GitHub
parent 17f003df0f
commit bd8cae6fdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -352,8 +352,10 @@ var Zotero_QuickFormat = new function () {
_openReferencePanel();
return;
}
// Otherwise, run the search if the input is non-empty.
if (!isInputEmpty(newInput)) {
// Otherwise, run the search if the input is non-empty
// or if we are citing notes (in which case, if the input is empty,
// most-recently modified notes are displayed)
if (!isInputEmpty(newInput) || Zotero_QuickFormat.citingNotes) {
_resetSearchTimer();
}
else {
@ -700,7 +702,7 @@ var Zotero_QuickFormat = new function () {
selectedItems = Zotero.getActiveZoteroPane().getSelectedItems().filter(i => i.isNote());
}
}
if (!searchString) {
if (!searchString && selectedItems.length) {
return [selectedItems, []];
}
else if (!searchResultIDs.length) {