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 +17
-5
lines changed
src/packages/user/user/components/user-media-start-node Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,18 @@ import { UmbMediaItemRepository } from '@umbraco-cms/backoffice/media';
55
66@customElement ( 'umb-user-media-start-node' )
77export class UmbUserMediaStartNodeElement extends UmbLitElement {
8+ #uniques: Array < string > = [ ] ;
89 @property ( { type : Array , attribute : false } )
9- uniques : Array < string > = [ ] ;
10+ public get uniques ( ) : Array < string > {
11+ return this . #uniques;
12+ }
13+ public set uniques ( value : Array < string > ) {
14+ this . #uniques = value ;
15+
16+ if ( this . #uniques. length > 0 ) {
17+ this . #observeItems( ) ;
18+ }
19+ }
1020
1121 @property ( { type : Boolean } )
1222 readonly = false ;
@@ -16,10 +26,12 @@ export class UmbUserMediaStartNodeElement extends UmbLitElement {
1626
1727 #itemRepository = new UmbMediaItemRepository ( this ) ;
1828
19- protected async firstUpdated ( ) : Promise < void > {
20- if ( this . uniques . length === 0 ) return ;
21- const { data } = await this . #itemRepository. requestItems ( this . uniques ) ;
22- this . _displayValue = data || [ ] ;
29+ async #observeItems( ) {
30+ const { asObservable } = await this . #itemRepository. requestItems ( this . #uniques) ;
31+
32+ this . observe ( asObservable ( ) , ( data ) => {
33+ this . _displayValue = data || [ ] ;
34+ } ) ;
2335 }
2436
2537 render ( ) {
You can’t perform that action at this time.
0 commit comments