mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:45:21 +00:00
Fix duplicate ChatViewModel disconnect messages
- Prevent didDisconnectFromPeer delegate call when peer gracefully left - This prevents duplicate 'rick disconnected' messages in chat UI
This commit is contained in:
@@ -3376,9 +3376,11 @@ extension BluetoothMeshService: CBCentralManagerDelegate {
|
||||
// Reset handshake state to prevent stuck handshakes
|
||||
handshakeCoordinator.resetHandshakeState(for: peerID)
|
||||
|
||||
// Notify delegate immediately about disconnect
|
||||
DispatchQueue.main.async {
|
||||
self.delegate?.didDisconnectFromPeer(peerID)
|
||||
// Notify delegate immediately about disconnect (unless peer gracefully left)
|
||||
if !gracefullyLeftPeers.contains(peerID) {
|
||||
DispatchQueue.main.async {
|
||||
self.delegate?.didDisconnectFromPeer(peerID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user