@@ -183,47 +183,20 @@ public async UniTask InitializeAsync(ChatPluginSettings settings, CancellationTo
183183
184184 // Log out / log in
185185 web3IdentityCache . OnIdentityCleared += OnIdentityCleared ;
186- web3IdentityCache . OnIdentityChanged += OnIdentityChanged ;
187-
188- realmData . RealmType . OnUpdate += OnRealmChange ;
189- realmNavigator . NavigationExecuted += OnNavigationExecuted ;
190- }
191-
192- /// <summary>
193- /// TODO: This is a temporary solution to show the chat when the user navigates to a parcel.
194- /// NOTE: check this PR for more details:
195- /// https://github.com/decentraland/unity-explorer/issues/4324
196- /// </summary>
197- /// <param name="parcel"></param>
198- private void OnNavigationExecuted ( Vector2Int parcel )
199- {
200- sharedSpaceManager . ShowAsync ( PanelsSharingSpace . Chat , new ChatControllerShowParams ( true , false ) ) . Forget ( ) ;
186+ loadingStatus . CurrentStage . OnUpdate += OnLoadingStatusUpdate ;
201187 }
202188
203- /// <summary>
204- /// TODO: This is a temporary solution to show the chat when the user changes realm.
205- /// NOTE: check this PR for more details:
206- /// https://github.com/decentraland/unity-explorer/issues/4324
207- /// </summary>
208- /// <param name="realmKind"></param>
209- private void OnRealmChange ( RealmKind realmKind )
189+ private void OnLoadingStatusUpdate ( LoadingStatus . LoadingStage status )
210190 {
211- sharedSpaceManager . ShowAsync ( PanelsSharingSpace . Chat , new ChatControllerShowParams ( true , false ) ) . Forget ( ) ;
191+ if ( status == LoadingStatus . LoadingStage . Completed )
192+ sharedSpaceManager . ShowAsync ( PanelsSharingSpace . Chat , new ChatControllerShowParams ( true , false ) ) . Forget ( ) ;
212193 }
213194
214195 private void OnIdentityCleared ( )
215196 {
216197 if ( chatController . IsVisibleInSharedSpace )
217198 chatController . HideViewAsync ( CancellationToken . None ) . Forget ( ) ;
218199 }
219-
220- private void OnIdentityChanged ( )
221- {
222- //This might pose a problem if we havent logged in yet (so we change session before first login), it works, but we are trying to show the chat twice
223- //Once from here and once from the MainUIController. We need to account for this.
224-
225- sharedSpaceManager . ShowAsync ( PanelsSharingSpace . Chat , new ChatControllerShowParams ( true , false ) ) . Forget ( ) ;
226- }
227200 }
228201
229202 public class ChatPluginSettings : IDCLPluginSettings
0 commit comments