@@ -95,11 +95,11 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
95
95
96
96
this . #eventContext. removeEventListener (
97
97
UmbEntityUpdatedEvent . TYPE ,
98
- this . #onEntityDetailUpdatedEvent as unknown as EventListener ,
98
+ this . #onEntityUpdatedEvent as unknown as EventListener ,
99
99
) ;
100
100
this . #eventContext. addEventListener (
101
101
UmbEntityUpdatedEvent . TYPE ,
102
- this . #onEntityDetailUpdatedEvent as unknown as EventListener ,
102
+ this . #onEntityUpdatedEvent as unknown as EventListener ,
103
103
) ;
104
104
} ) ;
105
105
}
@@ -324,13 +324,21 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
324
324
this . _data . setPersisted ( data ) ;
325
325
this . _data . setCurrent ( data ) ;
326
326
327
- const actionEventContext = await this . getContext ( UMB_ACTION_EVENT_CONTEXT ) ;
328
- const event = new UmbRequestReloadStructureForEntityEvent ( {
329
- unique : this . getUnique ( ) ! ,
330
- entityType : this . getEntityType ( ) ,
327
+ const unique = this . getUnique ( ) ! ;
328
+ const entityType = this . getEntityType ( ) ;
329
+
330
+ const eventContext = await this . getContext ( UMB_ACTION_EVENT_CONTEXT ) ;
331
+ const event = new UmbRequestReloadStructureForEntityEvent ( { unique, entityType } ) ;
332
+
333
+ eventContext . dispatchEvent ( event ) ;
334
+
335
+ const updatedEvent = new UmbEntityUpdatedEvent ( {
336
+ unique,
337
+ entityType,
338
+ discriminator : this . _workspaceEventDiscriminator ,
331
339
} ) ;
332
340
333
- actionEventContext . dispatchEvent ( event ) ;
341
+ eventContext . dispatchEvent ( updatedEvent ) ;
334
342
}
335
343
336
344
#allowNavigateAway = false ;
@@ -416,7 +424,7 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
416
424
// Discriminator to identify events from this workspace context
417
425
protected readonly _workspaceEventDiscriminator = UmbId . new ( ) ;
418
426
419
- #onEntityDetailUpdatedEvent = ( event : UmbEntityUpdatedEvent ) => {
427
+ #onEntityUpdatedEvent = ( event : UmbEntityUpdatedEvent ) => {
420
428
const eventEntityUnique = event . getUnique ( ) ;
421
429
const eventEntityType = event . getEntityType ( ) ;
422
430
const eventDiscriminator = event . getDiscriminator ( ) ;
@@ -435,7 +443,7 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
435
443
window . removeEventListener ( 'willchangestate' , this . #onWillNavigate) ;
436
444
this . #eventContext?. removeEventListener (
437
445
UmbEntityUpdatedEvent . TYPE ,
438
- this . #onEntityDetailUpdatedEvent as unknown as EventListener ,
446
+ this . #onEntityUpdatedEvent as unknown as EventListener ,
439
447
) ;
440
448
this . _detailRepository ?. destroy ( ) ;
441
449
this . #entityContext. destroy ( ) ;
0 commit comments