mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 22:05: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
|
// Reset handshake state to prevent stuck handshakes
|
||||||
handshakeCoordinator.resetHandshakeState(for: peerID)
|
handshakeCoordinator.resetHandshakeState(for: peerID)
|
||||||
|
|
||||||
// Notify delegate immediately about disconnect
|
// Notify delegate immediately about disconnect (unless peer gracefully left)
|
||||||
DispatchQueue.main.async {
|
if !gracefullyLeftPeers.contains(peerID) {
|
||||||
self.delegate?.didDisconnectFromPeer(peerID)
|
DispatchQueue.main.async {
|
||||||
|
self.delegate?.didDisconnectFromPeer(peerID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user