mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
fix(core): should display date as original title of journal (#11375)
Closes: [BS-2991](https://linear.app/affine-design/issue/BS-2991/linked-journal添加alias后,toolbar上获取不到标题)
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from '@blocksuite/affine-shared/consts';
|
||||
import {
|
||||
ActionPlacement,
|
||||
DocDisplayMetaProvider,
|
||||
type LinkEventType,
|
||||
type OpenDocMode,
|
||||
type ToolbarAction,
|
||||
@@ -76,11 +77,13 @@ const docTitleAction = {
|
||||
if (!model.props.title) return null;
|
||||
|
||||
const originalTitle =
|
||||
ctx.workspace.getDoc(model.props.pageId)?.meta?.title || 'Untitled';
|
||||
ctx.std.get(DocDisplayMetaProvider).title(model.props.pageId).value ||
|
||||
'Untitled';
|
||||
const open = (event: MouseEvent) => block.open({ event });
|
||||
|
||||
return html`<affine-linked-doc-title
|
||||
.title=${originalTitle}
|
||||
.open=${(event: MouseEvent) => block.open({ event })}
|
||||
.open=${open}
|
||||
></affine-linked-doc-title>`;
|
||||
},
|
||||
} as const satisfies ToolbarAction;
|
||||
|
||||
Reference in New Issue
Block a user