fix(core): retrieve missing search result titles (#4718)
This commit is contained in:
@@ -157,6 +157,7 @@ export const pageToCommand = (
|
|||||||
): CMDKCommand => {
|
): CMDKCommand => {
|
||||||
const pageMode = store.get(pageSettingsAtom)?.[page.id]?.mode;
|
const pageMode = store.get(pageSettingsAtom)?.[page.id]?.mode;
|
||||||
const currentWorkspaceId = store.get(currentWorkspaceIdAtom);
|
const currentWorkspaceId = store.get(currentWorkspaceIdAtom);
|
||||||
|
|
||||||
const title = page.title || t['Untitled']();
|
const title = page.title || t['Untitled']();
|
||||||
const commandLabel = label || {
|
const commandLabel = label || {
|
||||||
title: title,
|
title: title,
|
||||||
@@ -222,7 +223,7 @@ export const usePageCommands = () => {
|
|||||||
pageMode === 'edgeless' ? 'affine:edgeless' : 'affine:pages';
|
pageMode === 'edgeless' ? 'affine:edgeless' : 'affine:pages';
|
||||||
|
|
||||||
const label = {
|
const label = {
|
||||||
title: page.title,
|
title: page.title || t['Untitled'](), // Used to ensure that a title exists
|
||||||
subTitle:
|
subTitle:
|
||||||
searchResults.find(result => result.space === page.id)?.content ||
|
searchResults.find(result => result.space === page.id)?.content ||
|
||||||
'',
|
'',
|
||||||
|
|||||||
Reference in New Issue
Block a user