mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: fix notes lookup with non-existent tags
This commit is contained in:
committed by
Ammar Ahmed
parent
771a8bb4e3
commit
db8408f62f
@@ -155,6 +155,12 @@ export default class Lookup {
|
||||
? await this.db.notebooks.all.ids()
|
||||
: [];
|
||||
|
||||
if (
|
||||
(!!tag?.length && tag.length !== tagIds.length) ||
|
||||
(!!color?.length && color.length !== colorIds.length)
|
||||
)
|
||||
return emptySearchResults();
|
||||
|
||||
const defaultVault = await this.db.vaults.default();
|
||||
notes = notes.where((eb) => {
|
||||
const exprs = [];
|
||||
@@ -1212,3 +1218,12 @@ function highlightRegexMatches(
|
||||
function removeDiacritics(s: string) {
|
||||
return s.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||
}
|
||||
|
||||
function emptySearchResults() {
|
||||
return new VirtualizedGrouping<HighlightedResult>(
|
||||
0,
|
||||
20,
|
||||
() => Promise.resolve([]),
|
||||
() => Promise.resolve({ ids: [], items: [] })
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user