消息列表
This commit is contained in:
@@ -267,17 +267,7 @@ class HomeMenuFragment : Fragment() {
|
||||
try {
|
||||
val response = RetrofitNetwork.getNetworkService().getMessage()
|
||||
withContext(Dispatchers.Main) {
|
||||
if (response.code == 200 && response.data != null) {
|
||||
val messageGroups = response.data as List<*>
|
||||
var unreadCount = 0
|
||||
messageGroups.forEach { group ->
|
||||
if (group is Map<*, *>) {
|
||||
val list = group["list"] as? List<*>
|
||||
list?.let { unreadCount += it.size }
|
||||
}
|
||||
}
|
||||
MessageStatusManager.setUnreadCount(unreadCount)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
||||
Reference in New Issue
Block a user