diff --git a/Sources/SubVTData/Service/WSPRC/RPCSubscriptionService.swift b/Sources/SubVTData/Service/WSPRC/RPCSubscriptionService.swift index 8246c57..bcdfad0 100644 --- a/Sources/SubVTData/Service/WSPRC/RPCSubscriptionService.swift +++ b/Sources/SubVTData/Service/WSPRC/RPCSubscriptionService.swift @@ -285,6 +285,7 @@ public class RPCSubscriptionService: NSObject, ObservableObject, URL switch code { case .goingAway, .normalClosure: self.eventBus.send(completion: .finished) + self.status = .idle case .abnormalClosure: switch self.status { case .disconnected: @@ -293,10 +294,11 @@ public class RPCSubscriptionService: NSObject, ObservableObject, URL self.eventBus.send(completion: .failure(error)) default: self.eventBus.send(completion: .failure(.connection)) + self.status = .disconnected } default: self.eventBus.send(completion: .failure(.connection)) + self.status = .disconnected } - self.status = .disconnected } }