Skip to content

Commit 7bc567a

Browse files
authored
chore: add MainActor when mutating vpn state (#225)
1 parent eb30d90 commit 7bc567a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Coder-Desktop/Coder-Desktop/VPN/VPNService.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,12 @@ extension CoderVPNService {
185185
// Any -> Disconnected: Update UI w/ error if present
186186
case (_, .disconnected):
187187
connection.fetchLastDisconnectError { err in
188-
self.tunnelState = if let err {
189-
.failed(.internalError(err.localizedDescription))
190-
} else {
191-
.disabled
188+
Task { @MainActor in
189+
self.tunnelState = if let err {
190+
.failed(.internalError(err.localizedDescription))
191+
} else {
192+
.disabled
193+
}
192194
}
193195
}
194196
// Connecting -> Connecting: no-op

0 commit comments

Comments
 (0)