diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.ts index 6d0a15506..e59ac671d 100644 --- a/apps/client/src/entities/fnote.ts +++ b/apps/client/src/entities/fnote.ts @@ -839,8 +839,7 @@ export default class FNote { return []; } - const promotedAttrs = this.getAttributes() - .filter((attr) => attr.isDefinition()) + const promotedAttrs = this.getAttributeDefinitions() .filter((attr) => { const def = attr.getDefinition(); @@ -860,6 +859,11 @@ export default class FNote { return promotedAttrs; } + getAttributeDefinitions() { + return this.getAttributes() + .filter((attr) => attr.isDefinition()); + } + hasAncestor(ancestorNoteId: string, followTemplates = false, visitedNoteIds: Set | null = null) { if (this.noteId === ancestorNoteId) { return true; diff --git a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx index a8ae11c8a..51cb4649e 100644 --- a/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx +++ b/apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx @@ -91,7 +91,7 @@ function formatRelation(attr: AttributeWithDefinitions): ComponentChildren { } function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[] = []): AttributeWithDefinitions[] { - const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes(); + const promotedDefinitionAttributes = note.getAttributeDefinitions(); const result: AttributeWithDefinitions[] = []; for (const attr of promotedDefinitionAttributes) { const def = attr.getDefinition();