fix warnings
This commit is contained in:
@@ -28,7 +28,7 @@ final class EventStream {
|
||||
private var generation = 0
|
||||
private let monitor = NWPathMonitor()
|
||||
private var online: Bool?
|
||||
private var activeObserver: (any NSObjectProtocol)?
|
||||
private var activeObserver: NotificationCenter.ObservationToken?
|
||||
|
||||
init(api: API, after: Int64, lead: Bool, onEvent: @escaping (ByreEvent) -> Void, onState: @escaping (Bool) -> Void, onReady: @escaping () -> Void) {
|
||||
self.api = api
|
||||
@@ -50,10 +50,8 @@ final class EventStream {
|
||||
}
|
||||
}
|
||||
monitor.start(queue: .main)
|
||||
activeObserver = NotificationCenter.default.addObserver(forName: NSApplication.didBecomeActiveNotification, object: nil, queue: .main) { [weak self] _ in
|
||||
MainActor.assumeIsolated {
|
||||
self?.check()
|
||||
}
|
||||
activeObserver = NotificationCenter.default.addObserver(of: NSApplication.self, for: .didBecomeActive) { [weak self] _ in
|
||||
self?.check()
|
||||
}
|
||||
connect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user