fix(mobile-next): 把加载、失败、断网接到真实 SDK 与目录请求
会话列表、通讯录、好友申请、添加同事页覆盖 CompanyLoadingView/CompanyFailView; 主页断网横幅跟随 IMSdkStatus.connectionFailed。不伪造状态。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
092f513708
commit
2b2c2d28a4
@@ -14,10 +14,14 @@ class ContactsLogic extends GetxController
|
||||
final homeLogic = Get.find<HomeLogic>();
|
||||
|
||||
final friendApplicationList = <UserInfo>[];
|
||||
final loading = true.obs;
|
||||
final loadFailed = false.obs;
|
||||
|
||||
int get friendApplicationCount => homeLogic.unhandledFriendApplicationCount.value;
|
||||
int get friendApplicationCount =>
|
||||
homeLogic.unhandledFriendApplicationCount.value;
|
||||
|
||||
int get groupApplicationCount => homeLogic.unhandledGroupApplicationCount.value;
|
||||
int get groupApplicationCount =>
|
||||
homeLogic.unhandledGroupApplicationCount.value;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -28,6 +32,36 @@ class ContactsLogic extends GetxController
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
reload();
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
Future<void> reload() async {
|
||||
loading.value = true;
|
||||
loadFailed.value = false;
|
||||
try {
|
||||
await Future.wait([
|
||||
OpenIM.iMManager.friendshipManager
|
||||
.getFriendApplicationListAsRecipient(),
|
||||
OpenIM.iMManager.groupManager.getGroupApplicationListAsRecipient(),
|
||||
OpenIM.iMManager.friendshipManager.getFriendListPage(
|
||||
offset: 0,
|
||||
count: 1,
|
||||
filterBlack: true,
|
||||
),
|
||||
]);
|
||||
homeLogic.getUnhandledFriendApplicationCount();
|
||||
homeLogic.getUnhandledGroupApplicationCount();
|
||||
} catch (e, s) {
|
||||
Logger.print('contacts reload e: $e $s');
|
||||
loadFailed.value = true;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
PackageBridge.selectContactsBridge = null;
|
||||
@@ -69,7 +103,8 @@ class ContactsLogic extends GetxController
|
||||
);
|
||||
|
||||
@override
|
||||
viewUserProfile(String userID, String? nickname, String? faceURL, [String? groupID]) =>
|
||||
viewUserProfile(String userID, String? nickname, String? faceURL,
|
||||
[String? groupID]) =>
|
||||
AppNavigator.startUserProfilePane(
|
||||
userID: userID,
|
||||
nickname: nickname,
|
||||
@@ -85,5 +120,6 @@ class ContactsLogic extends GetxController
|
||||
);
|
||||
|
||||
@override
|
||||
scanOutUserID(String userID) => AppNavigator.startUserProfilePane(userID: userID, offAndToNamed: true);
|
||||
scanOutUserID(String userID) =>
|
||||
AppNavigator.startUserProfilePane(userID: userID, offAndToNamed: true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user