fix(core): retrieve missing search result titles (#4718)

This commit is contained in:
JimmFly 2023-10-25 18:45:14 +08:00 committed by GitHub
parent 559ec3956f
commit 780c164cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ||
'',