Skip to content

Commit 60054a8

Browse files
madsrasmusseniOvergaard
authored andcommitted
Ensure entity structure is reloaded after publish
1 parent 2cf83ec commit 60054a8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/packages/documents/documents/workspace/document-workspace.context.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ export class UmbDocumentWorkspaceContext
589589
this.#persistedData.setValue(data);
590590
this.#currentData.setValue(data);
591591

592-
// TODO: this might not be the right place to alert the tree, but it works for now
593592
const eventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT);
594593
const event = new UmbRequestReloadChildrenOfEntityEvent({
595594
entityType: parent.entityType,
@@ -718,6 +717,14 @@ export class UmbDocumentWorkspaceContext
718717
unique,
719718
variantIds.map((variantId) => ({ variantId })),
720719
);
720+
721+
const eventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT);
722+
const event = new UmbRequestReloadStructureForEntityEvent({
723+
unique: this.getUnique()!,
724+
entityType: this.getEntityType(),
725+
});
726+
727+
eventContext.dispatchEvent(event);
721728
}
722729

723730
async #handleSave() {

0 commit comments

Comments
 (0)