From f23d0618697d05cf75cbaddab0b2668d5f2442ca Mon Sep 17 00:00:00 2001 From: Maksim Karmatskikh Date: Wed, 29 Nov 2023 20:14:37 +0100 Subject: [PATCH] UBERF-4486: Fix mention and spotlight categories (#4108) Signed-off-by: Maxim Karmatskikh --- packages/presentation/src/search.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/presentation/src/search.ts b/packages/presentation/src/search.ts index 9ae6ea7f37..269f0a5847 100644 --- a/packages/presentation/src/search.ts +++ b/packages/presentation/src/search.ts @@ -102,11 +102,12 @@ const categoriesByContext = new Map() export async function searchFor (context: 'mention' | 'spotlight', query: string): Promise { 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 [] }