Explorar o código

好友列表获取bug修复

lvjincheng %!s(int64=3) %!d(string=hai) anos
pai
achega
c505edd544

+ 3 - 3
Assets/BowArrow/Scripts/Network/UserPlayer.cs

@@ -119,11 +119,11 @@ public class UserPlayer : JCEntity
             else AuthLoginMask.ins?.SetAutoRetryFail();
         }));
     }
-    private bool _hasGetUserInfo = false;
+    public bool hasGetUserInfo;
     private void DoAfterGetUserInfo(UserInfo userInfo)
     {
-        if (_hasGetUserInfo) return;
-        _hasGetUserInfo = true;
+        if (hasGetUserInfo) return;
+        hasGetUserInfo = true;
         LoginMgr.myUserInfo = userInfo;
 
         if (HomeView.ins) {

+ 2 - 2
Assets/BowArrow/Scripts/View/Home/HomeView.cs

@@ -169,7 +169,7 @@ public class HomeView : JCUnityLib.ViewBase
         if (friendBarContent == null) {
             friendBarContent = transform.Find("FriendBar/Scroll View/Viewport/Content");
         }
-        while (UserPlayer.ins == null || !UserPlayer.ins.loginAuthed) {
+        while (UserPlayer.ins == null || !UserPlayer.ins.loginAuthed || !UserPlayer.ins.hasGetUserInfo) {
             yield return null;
         }
         Action<JArray> cb = RenderFriendList;
@@ -215,7 +215,7 @@ public class HomeView : JCUnityLib.ViewBase
         if (friendBarContent == null) {
             friendBarContent = transform.Find("FriendBar/Scroll View/Viewport/Content");
         }
-        while (UserPlayer.ins == null || !UserPlayer.ins.loginAuthed) {
+        while (UserPlayer.ins == null || !UserPlayer.ins.loginAuthed || !UserPlayer.ins.hasGetUserInfo) {
             yield return null;
         }
         Action<JArray> cb = RenderFriendRankList;