Fix private message notifications and chat updates

- Remove self-notification when sending private messages
- Clear unread indicator when viewing active chat
- Properly update UI when private messages are sent/received
- Prevent duplicate messages in chat history
- Use objectWillChange to force SwiftUI updates
This commit is contained in:
jack
2025-07-02 21:19:32 +02:00
parent fc5eba4a58
commit 13686b3ce9
3 changed files with 31 additions and 13 deletions
+1 -4
View File
@@ -226,10 +226,7 @@ class BluetoothMeshService: NSObject {
print("[DEBUG] Sending private message to \(recipientNickname): \(content)")
self.broadcastPacket(packet)
// Also show the message locally
DispatchQueue.main.async {
self.delegate?.didReceiveMessage(message)
}
// Don't call didReceiveMessage here - let the view model handle it directly
}
}
}