This repository was archived by the owner on Nov 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/packages/media/media/collection Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ import { UMB_MEDIA_ENTITY_TYPE , UMB_MEDIA_ROOT_ENTITY_TYPE } from '../entity.js' ;
12import { UMB_MEDIA_WORKSPACE_CONTEXT } from '../workspace/media-workspace.context-token.js' ;
23import type { UmbMediaCollectionContext } from './media-collection.context.js' ;
34import { UMB_MEDIA_COLLECTION_CONTEXT } from './media-collection.context-token.js' ;
@@ -6,6 +7,8 @@ import { UmbCollectionDefaultElement } from '@umbraco-cms/backoffice/collection'
67import type { UmbProgressEvent } from '@umbraco-cms/backoffice/event' ;
78
89import './media-collection-toolbar.element.js' ;
10+ import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action' ;
11+ import { UmbRequestReloadChildrenOfEntityEvent } from '@umbraco-cms/backoffice/entity-action' ;
912
1013@customElement ( 'umb-media-collection' )
1114export class UmbMediaCollectionElement extends UmbCollectionDefaultElement {
@@ -29,9 +32,16 @@ export class UmbMediaCollectionElement extends UmbCollectionDefaultElement {
2932 } ) ;
3033 }
3134
32- #onChange( ) {
35+ async #onChange( ) {
3336 this . _progress = - 1 ;
3437 this . #mediaCollection?. requestCollection ( ) ;
38+
39+ const eventContext = await this . getContext ( UMB_ACTION_EVENT_CONTEXT ) ;
40+ const event = new UmbRequestReloadChildrenOfEntityEvent ( {
41+ entityType : this . _unique ? UMB_MEDIA_ENTITY_TYPE : UMB_MEDIA_ROOT_ENTITY_TYPE ,
42+ unique : this . _unique ,
43+ } ) ;
44+ eventContext . dispatchEvent ( event ) ;
3545 }
3646
3747 #onProgress( event : UmbProgressEvent ) {
You can’t perform that action at this time.
0 commit comments