Skip to content

Commit

Permalink
feat: auto-connect socket on channel subscription (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev authored Dec 21, 2023
1 parent 5382411 commit edeb20e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Realtime/RealtimeChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ public class RealtimeChannel {
timeout: TimeInterval? = nil,
callback: ((RealtimeSubscribeStates, Error?) -> Void)? = nil
) -> RealtimeChannel {
if socket?.isConnected == false {
socket?.connect()
}

guard !joinedOnce else {
fatalError(
"tried to join multiple times. 'join' "
Expand Down

0 comments on commit edeb20e

Please sign in to comment.