From 780c164cc8e12122ce8740d88b69ea3c37a62eb0 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 25 Oct 2023 18:45:14 +0800 Subject: [PATCH] fix(core): retrieve missing search result titles (#4718) --- packages/frontend/core/src/components/pure/cmdk/data.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend/core/src/components/pure/cmdk/data.tsx b/packages/frontend/core/src/components/pure/cmdk/data.tsx index bb0c5b358a..6c0d6779d7 100644 --- a/packages/frontend/core/src/components/pure/cmdk/data.tsx +++ b/packages/frontend/core/src/components/pure/cmdk/data.tsx @@ -157,6 +157,7 @@ export const pageToCommand = ( ): CMDKCommand => { const pageMode = store.get(pageSettingsAtom)?.[page.id]?.mode; const currentWorkspaceId = store.get(currentWorkspaceIdAtom); + const title = page.title || t['Untitled'](); const commandLabel = label || { title: title, @@ -222,7 +223,7 @@ export const usePageCommands = () => { pageMode === 'edgeless' ? 'affine:edgeless' : 'affine:pages'; const label = { - title: page.title, + title: page.title || t['Untitled'](), // Used to ensure that a title exists subTitle: searchResults.find(result => result.space === page.id)?.content || '',