UBERF-4486: Fix mention and spotlight categories (#4108)

Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
Maksim Karmatskikh 2023-11-29 20:14:37 +01:00 committed by GitHub
parent 0a7faafa2e
commit f23d061869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,11 +102,12 @@ const categoriesByContext = new Map<string, ObjectSearchCategory[]>()
export async function searchFor (context: 'mention' | 'spotlight', query: string): Promise<SearchItem[]> {
const client = getClient()
let categories
if (categoriesByContext.get(context) === undefined) {
let categories = categoriesByContext.get(context)
if (categories === undefined) {
categories = await client.findAll(plugin.class.ObjectSearchCategory, { context })
categoriesByContext.set(context, categories)
}
if (categories === undefined) {
return []
}