diff --git a/apps/client/src/widgets/ribbon_widgets/book_properties.ts b/apps/client/src/widgets/ribbon_widgets/book_properties.ts index 5a2c9d324..c48fc6d6b 100644 --- a/apps/client/src/widgets/ribbon_widgets/book_properties.ts +++ b/apps/client/src/widgets/ribbon_widgets/book_properties.ts @@ -70,6 +70,7 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget { private $expandChildrenButton!: JQuery; private $collapseAllButton!: JQuery; private $propertiesContainer!: JQuery; + private labelsToWatch: string[] = []; get name() { return "bookProperties"; @@ -146,6 +147,7 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget { if (bookPropertiesData) { for (const property of bookPropertiesData.properties) { this.$propertiesContainer.append(renderBookProperty(property, note)); + this.labelsToWatch.push(property.bindToLabel); } } } @@ -163,7 +165,9 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget { } entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { - if (loadResults.getAttributeRows().find((attr) => attr.noteId === this.noteId && attr.name === "viewType")) { + if (loadResults.getAttributeRows().find((attr) => + attr.noteId === this.noteId + && (attr.name === "viewType" || this.labelsToWatch.includes(attr.name ?? "")))) { this.refresh(); } }