Expose network state to iOS bridge
This commit is contained in:
@@ -2,6 +2,7 @@ import Foundation
|
||||
|
||||
public protocol SessionBridge: Sendable {
|
||||
func authState() async throws -> AuthState
|
||||
func networkState() async throws -> NetworkState
|
||||
func pollEvents() async throws -> [SessionEvent]
|
||||
func sendPhoneNumber(_ phone: String) async throws
|
||||
func sendCode(_ code: String) async throws
|
||||
@@ -66,6 +67,10 @@ public actor FakeSessionBridge: SessionBridge {
|
||||
auth
|
||||
}
|
||||
|
||||
public func networkState() async throws -> NetworkState {
|
||||
.ready
|
||||
}
|
||||
|
||||
public func pollEvents() async throws -> [SessionEvent] {
|
||||
let drained = events
|
||||
events.removeAll()
|
||||
|
||||
Reference in New Issue
Block a user