mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-06 07:46:32 +00:00
UBERF-4486: Fix mention and spotlight categories (#4108)
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
parent
0a7faafa2e
commit
f23d061869
@ -102,11 +102,12 @@ const categoriesByContext = new Map<string, ObjectSearchCategory[]>()
|
|||||||
|
|
||||||
export async function searchFor (context: 'mention' | 'spotlight', query: string): Promise<SearchItem[]> {
|
export async function searchFor (context: 'mention' | 'spotlight', query: string): Promise<SearchItem[]> {
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
let categories
|
let categories = categoriesByContext.get(context)
|
||||||
if (categoriesByContext.get(context) === undefined) {
|
if (categories === undefined) {
|
||||||
categories = await client.findAll(plugin.class.ObjectSearchCategory, { context })
|
categories = await client.findAll(plugin.class.ObjectSearchCategory, { context })
|
||||||
categoriesByContext.set(context, categories)
|
categoriesByContext.set(context, categories)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (categories === undefined) {
|
if (categories === undefined) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user