core, ui: update member support chats list from events instead of reloading all members

This commit is contained in:
Narasimha-sc
2026-09-30 15:38:13 +00:00
parent 93910b80e9
commit 84ed5a9a2b
14 changed files with 118 additions and 58 deletions
+3
View File
@@ -1923,6 +1923,7 @@ func apiMarkChatItemsRead(_ im: ItemsModel, _ cInfo: ChatInfo, _ itemIds: [ChatI
let updatedChatInfo = try await apiChatItemsRead(type: cInfo.chatType, id: cInfo.apiId, scope: cInfo.groupChatScope(), itemIds: itemIds)
await MainActor.run {
ChatModel.shared.updateChatInfo(updatedChatInfo)
ChatModel.shared.upsertSupportChatMember(updatedChatInfo)
ChatModel.shared.markChatItemsRead(im, cInfo, itemIds, mentionsRead)
}
} catch {
@@ -2625,6 +2626,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
if cItem.isActiveReport {
m.increaseGroupReportsCounter(cInfo.id)
}
m.upsertSupportChatMember(cInfo)
} else if cItem.isRcvNew && cInfo.ntfsEnabled(chatItem: cItem) {
m.increaseUnreadCounter(user: user)
}
@@ -2690,6 +2692,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
if item.deletedChatItem.chatItem.isActiveReport {
m.decreaseGroupReportsCounter(item.deletedChatItem.chatInfo.id)
}
m.upsertSupportChatMember(item.deletedChatItem.chatInfo)
}
if let updatedChatInfo = items.last?.deletedChatItem.chatInfo {
m.updateChatInfo(updatedChatInfo)