Fix compiler warning: use let for reference type array

BitchatMessage is a class, so modifying its properties through an array
reference doesn't mutate the array itself. Changed var to let binding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jack
2026-01-14 10:18:16 -10:00
co-authored by Claude Opus 4.5
parent 0c3f84224c
commit 293d627c28
+1 -1
View File
@@ -3155,7 +3155,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv
let (foundPeerID, idx) = findMessageIndex(messageID: messageID, peerID: peerID) else { return } let (foundPeerID, idx) = findMessageIndex(messageID: messageID, peerID: peerID) else { return }
// Explicitly unwrap and re-assign to ensure the @Published setter is called // Explicitly unwrap and re-assign to ensure the @Published setter is called
if var messages = privateChats[foundPeerID], idx < messages.count { if let messages = privateChats[foundPeerID], idx < messages.count {
messages[idx].deliveryStatus = .read(by: name, at: Date()) messages[idx].deliveryStatus = .read(by: name, at: Date())
privateChats[foundPeerID] = messages privateChats[foundPeerID] = messages
privateChatManager.objectWillChange.send() privateChatManager.objectWillChange.send()