search: fix "search all" button disabling logic, more

just a few more general fixes. Also changed the "Search all" button to
say "Search/sort all".
This commit is contained in:
Harvey Tindall
2025-05-26 21:52:31 +01:00
parent 372514709d
commit 2657e74803
4 changed files with 38 additions and 29 deletions
+10 -12
View File
@@ -420,18 +420,16 @@ export class Search {
// Returns a list of identifiers (used as keys in items, values in ordering).
searchParsed = (searchTerms: string[], queries: Query[]): string[] => {
let result: string[] = [...this._ordering];
// If we're in a server search already, the results are (probably) already correct.
if (this.inServerSearch) {
let hasLocalOnlyQueries = false;
for (const q of queries) {
if (q.localOnly) {
hasLocalOnlyQueries = true;
break;
}
}
if (!hasLocalOnlyQueries) return result;
// Continue on if really necessary
}
// If we didn't care about rendering the query cards, we could run this to (maybe) return early.
// if (this.inServerSearch) {
// let hasLocalOnlyQueries = false;
// for (const q of queries) {
// if (q.localOnly) {
// hasLocalOnlyQueries = true;
// break;
// }
// }
// }
// Normal searches can be evaluated by the server, so skip this if we've already ran one.
if (!this.inServerSearch) {