Browse Source

[new]优化首页默认选中好友

zk 6 tháng trước cách đây
mục cha
commit
131ed612bf
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      lib/module/main/main_controller.dart

+ 7 - 2
lib/module/main/main_controller.dart

@@ -96,7 +96,7 @@ class MainController extends BaseController {
 
     loginSubscription = accountRepository.isLogin.listen((isLogin) {
       if (isLogin == false) {
-        _selectedFriend.value = null;
+        _selectedFriend.value = mineUserInfo;
       }
     });
     friendsListSubscription = _friendsList.listen((list) {
@@ -365,7 +365,12 @@ class MainController extends BaseController {
   }
 
   void _autoSelectFriend() {
-    if (lastCheckFriendId == null || isExecuteAutoSelect) {
+    if (isExecuteAutoSelect) {
+      return;
+    }
+    if (lastCheckFriendId == null) {
+      _setSelectUserInfo(mineUserInfo);
+      isExecuteAutoSelect = true;
       return;
     }
     for (var value in integrateList) {