mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 10:06:17 +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:
@@ -1,6 +1,7 @@
|
||||
import { notifyLinkedDocSwitchedToEmbed } from '@blocksuite/affine-components/notification';
|
||||
import {
|
||||
ActionPlacement,
|
||||
DocDisplayMetaProvider,
|
||||
type ToolbarAction,
|
||||
type ToolbarActionGroup,
|
||||
type ToolbarModuleConfig,
|
||||
@@ -34,9 +35,14 @@ export const builtinInlineReferenceToolbarConfig = {
|
||||
if (!(target instanceof AffineReference)) return null;
|
||||
if (!target.referenceInfo.title) return null;
|
||||
|
||||
const originalTitle =
|
||||
ctx.std.get(DocDisplayMetaProvider).title(target.referenceInfo.pageId)
|
||||
.value || 'Untitled';
|
||||
const open = (event: MouseEvent) => target.open({ event });
|
||||
|
||||
return html`<affine-linked-doc-title
|
||||
.title=${target.docTitle}
|
||||
.open=${(event: MouseEvent) => target.open({ event })}
|
||||
.title=${originalTitle}
|
||||
.open=${open}
|
||||
></affine-linked-doc-title>`;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user