Skip to content

Commit 52bc09a

Browse files
committed
fix: onclose callback to trigger in reconnects too
1 parent 997e27a commit 52bc09a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

templates/swift/Sources/Services/Realtime.swift.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ extension Realtime: WebSocketClientDelegate {
221221

222222
public func onClose(channel: Channel, data: Data) async throws {
223223
stopHeartbeat()
224+
225+
onCloseCallbacks.forEach { $0() }
224226

225227
if (!reconnect) {
226-
onCloseCallbacks.forEach { $0() }
227228
reconnect = true
228229
return
229230
}

0 commit comments

Comments
 (0)