1
- import type { UmbUserDetailModel , UmbUserStateEnum } from '../types.js' ;
1
+ import type { UmbUserDetailModel , UmbUserStartNodesModel , UmbUserStateEnum } from '../types.js' ;
2
2
import { UMB_USER_ENTITY_TYPE } from '../entity.js' ;
3
3
import { UmbUserDetailRepository } from '../repository/index.js' ;
4
4
import { UmbUserAvatarRepository } from '../repository/avatar/index.js' ;
@@ -31,6 +31,9 @@ export class UmbUserWorkspaceContext
31
31
readonly mediaStartNodeUniques = this . #currentData. asObservablePart ( ( data ) => data ?. mediaStartNodeUniques || [ ] ) ;
32
32
readonly hasMediaRootAccess = this . #currentData. asObservablePart ( ( data ) => data ?. hasMediaRootAccess || false ) ;
33
33
34
+ #calculatedStartNodes = new UmbObjectState < UmbUserStartNodesModel | undefined > ( undefined ) ;
35
+ readonly calculatedStartNodes = this . #calculatedStartNodes. asObservable ( ) ;
36
+
34
37
readonly routes = new UmbWorkspaceRouteManager ( this ) ;
35
38
36
39
constructor ( host : UmbControllerHost ) {
@@ -50,6 +53,7 @@ export class UmbUserWorkspaceContext
50
53
51
54
async load ( unique : string ) {
52
55
const { data, asObservable } = await this . detailRepository . requestByUnique ( unique ) ;
56
+
53
57
if ( data ) {
54
58
this . setIsNew ( false ) ;
55
59
this . #persistedData. update ( data ) ;
@@ -58,11 +62,9 @@ export class UmbUserWorkspaceContext
58
62
59
63
this . observe ( asObservable ( ) , ( user ) => this . onUserStoreChanges ( user ) , 'umbUserStoreObserver' ) ;
60
64
65
+ // Get the calculated start nodes
61
66
const { data : calculatedStartNodes } = await this . detailRepository . requestCalculateStartNodes ( unique ) ;
62
-
63
- if ( calculatedStartNodes ) {
64
- console . log ( 'calculatedStartNodes' , calculatedStartNodes ) ;
65
- }
67
+ this . #calculatedStartNodes. setValue ( calculatedStartNodes ) ;
66
68
}
67
69
68
70
/* TODO: some properties are allowed to update without saving.
0 commit comments