Skip to content

Commit

Permalink
fix: should show alias icon when title has alias (#8880)
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 6, 2024
1 parent 807e9b7 commit a89593d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@blocksuite/block-std';
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
import { WithDisposable } from '@blocksuite/global/utils';
import { AliasIcon } from '@blocksuite/icons/lit';
import {
type DeltaInsert,
INLINE_ROOT_ATTR,
Expand Down Expand Up @@ -241,6 +242,9 @@ export class AffineReference extends WithDisposable(ShadowlessElement) {
return nothing;
}

const hasTitleAlias = Boolean(
reference?.title && reference.title.length > 0
);
const title = this.customTitle
? this.customTitle(this)
: isDeleted
Expand All @@ -252,7 +256,12 @@ export class AffineReference extends WithDisposable(ShadowlessElement) {
[
[
'LinkedPage',
() => (this.isLinkToNode() ? BlockLinkIcon : FontLinkedDocIcon),
() =>
hasTitleAlias
? AliasIcon()
: this.isLinkToNode()
? BlockLinkIcon
: FontLinkedDocIcon,
],
['Subpage', () => FontDocIcon],
],
Expand Down

0 comments on commit a89593d

Please sign in to comment.