فهرست منبع

好友列表获取bug修复

lvjincheng 3 سال پیش
والد
کامیت
c505edd544
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 3 3
      Assets/BowArrow/Scripts/Network/UserPlayer.cs
  2. 2 2
      Assets/BowArrow/Scripts/View/Home/HomeView.cs

+ 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;