Skip to content

Commit 1e8b34d

Browse files
committed
Fix check on self.options.autoReconnect
1 parent 6d7186a commit 1e8b34d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Source/PusherWebsocketDelegate.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ extension PusherConnection: WebSocketDelegate {
3636
for (_, channel) in self.channels.channels {
3737
channel.subscribed = false
3838
}
39-
39+
4040
// Handle error (if any)
4141
guard let error = error where error.code != Int(WebSocket.CloseCode.Normal.rawValue) else {
4242
return
4343
}
44-
44+
4545
print("Websocket is disconnected. Error: \(error.localizedDescription)")
46-
46+
4747
// Reconnect if possible
48-
if let reconnect = self.options.autoReconnect where reconnect {
48+
if self.options.autoReconnect {
4949
if let reachability = self.reachability where reachability.isReachable() {
5050
let operation = NSBlockOperation {
5151
self.socket.connect()
@@ -64,4 +64,3 @@ extension PusherConnection: WebSocketDelegate {
6464
public func websocketDidConnect(ws: WebSocket) {}
6565
public func websocketDidReceiveData(ws: WebSocket, data: NSData) {}
6666
}
67-

0 commit comments

Comments
 (0)