mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-30 02:37:46 +03: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[]> {
|
||||
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 []
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user