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' ;
1
2
import { UMB_MEDIA_WORKSPACE_CONTEXT } from '../workspace/media-workspace.context-token.js' ;
2
3
import type { UmbMediaCollectionContext } from './media-collection.context.js' ;
3
4
import { UMB_MEDIA_COLLECTION_CONTEXT } from './media-collection.context-token.js' ;
@@ -6,6 +7,8 @@ import { UmbCollectionDefaultElement } from '@umbraco-cms/backoffice/collection'
6
7
import type { UmbProgressEvent } from '@umbraco-cms/backoffice/event' ;
7
8
8
9
import './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' ;
9
12
10
13
@customElement ( 'umb-media-collection' )
11
14
export class UmbMediaCollectionElement extends UmbCollectionDefaultElement {
@@ -29,9 +32,16 @@ export class UmbMediaCollectionElement extends UmbCollectionDefaultElement {
29
32
} ) ;
30
33
}
31
34
32
- #onChange( ) {
35
+ async #onChange( ) {
33
36
this . _progress = - 1 ;
34
37
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 ) ;
35
45
}
36
46
37
47
#onProgress( event : UmbProgressEvent ) {
You can’t perform that action at this time.
0 commit comments