Skip to content

Commit cfed874

Browse files
committed
Use receive("ok")
1 parent bf6dbd5 commit cfed874

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,10 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
268268
!channel.isClosed
269269
{
270270
await withCheckedContinuation { continuation in
271-
var ref: Int?
272-
ref = channel.onClose { [weak channel] _ in
273-
channel?.off("phx_close", ref: ref)
274-
continuation.resume()
275-
}
276271
channel.leave()
272+
.receive("ok") { _ in
273+
continuation.resume()
274+
}
277275
}
278276
}
279277
channel = nil

0 commit comments

Comments
 (0)