mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 23:05:20 +00:00
Fix UI not updating for delivery status changes
- Use message ID instead of index for ForEach to trigger proper updates - Add explicit objectWillChange.send() when updating delivery status - Fix scroll-to-bottom logic to use message IDs - This should make blue checkmarks appear when read receipts are received
This commit is contained in:
@@ -2142,6 +2142,11 @@ extension ChatViewModel: BitchatDelegate {
|
||||
chatMessages[index] = updatedMessage
|
||||
privateChats[peerID] = chatMessages
|
||||
print("[Delivery] Updated message in private chat with \(peerID)")
|
||||
|
||||
// Force UI update by triggering objectWillChange
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.objectWillChange.send()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2152,6 +2157,11 @@ extension ChatViewModel: BitchatDelegate {
|
||||
updatedMessage.deliveryStatus = status
|
||||
roomMsgs[index] = updatedMessage
|
||||
roomMessages[room] = roomMsgs
|
||||
|
||||
// Force UI update
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.objectWillChange.send()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user