Skip to content

Commit e7fde8c

Browse files
authored
Entity-Action Bundle: Ensure First Action are updated in rendering (#20351)
ensure requesting rendering update
1 parent a95a2b9 commit e7fde8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ export class UmbEntityActionsBundleElement extends UmbLitElement {
7777
(ext) => ext.forEntityTypes.includes(this.entityType!),
7878
async (actions) => {
7979
this._numberOfActions = actions.length;
80+
const oldFirstManifest = this._firstActionManifest;
8081
this._firstActionManifest =
8182
this._numberOfActions > 0 ? (actions[0].manifest as ManifestEntityActionDefaultKind) : undefined;
82-
this.#createFirstActionApi();
83+
await this.#createFirstActionApi();
84+
this.requestUpdate('_firstActionManifest', oldFirstManifest);
8385
},
8486
'umbEntityActionsObserver',
8587
);
@@ -89,13 +91,15 @@ export class UmbEntityActionsBundleElement extends UmbLitElement {
8991

9092
async #createFirstActionApi() {
9193
if (!this._firstActionManifest) return;
94+
const oldFirstApi = this._firstActionApi;
9295
this._firstActionApi = await createExtensionApi(this, this._firstActionManifest, [
9396
{ unique: this.unique, entityType: this.entityType, meta: this._firstActionManifest.meta },
9497
]);
9598
if (this._firstActionApi) {
9699
(this._firstActionApi as any).manifest = this._firstActionManifest;
97100
this._firstActionHref = await this._firstActionApi.getHref();
98101
}
102+
this.requestUpdate('_firstActionApi', oldFirstApi);
99103
}
100104

101105
async #onFirstActionClick(event: PointerEvent) {

0 commit comments

Comments
 (0)