From af173066d502a63b12fc968f0b8d4bf8a65a53b4 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Tue, 21 Oct 2025 03:28:39 +0300 Subject: [PATCH] patch --- yobble/Services/SocketService.swift | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/yobble/Services/SocketService.swift b/yobble/Services/SocketService.swift index 39579b2..5131703 100644 --- a/yobble/Services/SocketService.swift +++ b/yobble/Services/SocketService.swift @@ -149,6 +149,27 @@ final class SocketService { self.updateConnectionState(.connected) } + socket.on(clientEvent: .statusChange) { data, _ in + guard let rawStatus = data.first as? SocketIOStatus else { return } + if rawStatus == .connected { + self.updateConnectionState(.connected) + } else if rawStatus == .connecting { + self.updateConnectionState(.connecting) + } else { + self.updateConnectionState(.disconnected) + } + } + + socket.on(clientEvent: .reconnect) { _, _ in + if AppConfig.DEBUG { print("[SocketService] Reconnecting") } + self.updateConnectionState(.connecting) + } + + socket.on(clientEvent: .reconnectAttempt) { data, _ in + if AppConfig.DEBUG { print("[SocketService] Reconnect attempt: \(data)") } + self.updateConnectionState(.connecting) + } + socket.on(clientEvent: .disconnect) { data, _ in if AppConfig.DEBUG { print("[SocketService] Disconnected: \(data)") } self.updateConnectionState(.disconnected)