Skip to content

Commit 311c258

Browse files
committed
move Combine notification to markConnectionConnected()
1 parent e671eb8 commit 311c258

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/SwiftOCA/OCP.1/Ocp1Connection+Connect.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ extension Ocp1Connection {
169169
func markConnectionConnected() {
170170
logger.info("connected to \(self)")
171171
_updateConnectionState(.connected)
172+
#if canImport(Combine) || canImport(OpenCombine)
173+
objectWillChange.send()
174+
#endif
172175
}
173176

174177
private func _didConnectDevice() async throws {
@@ -184,10 +187,6 @@ extension Ocp1Connection {
184187
try await sendKeepAlive()
185188
}
186189

187-
#if canImport(Combine) || canImport(OpenCombine)
188-
objectWillChange.send()
189-
#endif
190-
191190
await _refreshSubscriptionsWithPolicy()
192191
await _refreshDeviceTreeWithPolicy()
193192
}

0 commit comments

Comments
 (0)