File tree Expand file tree Collapse file tree
Assets/Scripts/Scenes/List Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,15 +162,10 @@ void Start()
162162 void DisplayUserInfo ( )
163163 {
164164 //TODO: display multiple endpoints
165- var apiendpoint = MajEnv . Settings . Online . ApiEndpoints . FirstOrDefault ( ) ;
166- if ( apiendpoint is not null )
167- {
168- _userProfileDisplayer . DisplayUserInfo ( apiendpoint ) ;
169- }
170- else
171- {
172- _userProfileDisplayer . gameObject . SetActive ( false ) ;
173- }
165+ var apiEndpoint = MajEnv . ApiEndpoints . FirstOrDefault ( x => x . RuntimeConfig . IsLoggedIn )
166+ ?? MajEnv . ApiEndpoints . FirstOrDefault ( ) ;
167+
168+ _userProfileDisplayer . DisplayUserInfo ( apiEndpoint ) ;
174169 }
175170
176171 async UniTaskVoid InitializeCoverListAsync ( )
Original file line number Diff line number Diff line change @@ -40,20 +40,22 @@ void Update()
4040 Refresh ( ) ;
4141 }
4242
43- public void DisplayUserInfo ( ApiEndpoint apiEndpoint )
43+ public void DisplayUserInfo ( ApiEndpoint ? apiEndpoint )
4444 {
4545 _currentApiEndpoint = apiEndpoint ;
46+ gameObject . SetActive ( apiEndpoint is not null ) ;
47+
48+ if ( apiEndpoint is not null )
49+ {
50+ Refresh ( ) ;
51+ }
4652 }
4753
4854 public void DisplayFromSong ( ISongDetail song )
4955 {
50- if ( song is not OnlineSongDetail )
51- {
52- gameObject . SetActive ( false ) ;
53- return ;
54- }
55- var serverInfo = ( ( OnlineSongDetail ) song ) . ServerInfo ;
56- DisplayUserInfo ( serverInfo ) ;
56+ DisplayUserInfo ( song is OnlineSongDetail onlineSong
57+ ? onlineSong . ServerInfo
58+ : null ) ;
5759 }
5860
5961 void Refresh ( )
You can’t perform that action at this time.
0 commit comments