Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanndickson committed Feb 12, 2025
1 parent febf414 commit cfb3dd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Coder Desktop/Coder Desktop/Views/VPNMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct VPNMenu<VPN: VPNService, S: Session>: View {
// an error is shown: "The VPN session failed because an internal error occurred".
// This forces the user to wait a few seconds before they can toggle the VPN back on.
@State private var waitCleanup = false
private var waitCleanupDuration: Duration = .seconds(4)
private var waitCleanupDuration: Duration = .seconds(4)

let inspection = Inspection<Self>()

Expand Down Expand Up @@ -94,7 +94,7 @@ struct VPNMenu<VPN: VPNService, S: Session>: View {

private var vpnDisabled: Bool {
waitCleanup ||
!session.hasSession ||
!session.hasSession ||
vpn.state == .connecting ||
vpn.state == .disconnecting ||
vpn.state == .failed(.systemExtensionError(.needsUserApproval))
Expand All @@ -104,7 +104,7 @@ struct VPNMenu<VPN: VPNService, S: Session>: View {
await vpn.stop()
waitCleanup = true
Task {
try await Task.sleep(for: waitCleanupDuration)
try? await Task.sleep(for: waitCleanupDuration)
waitCleanup = false
}
}
Expand Down

0 comments on commit cfb3dd5

Please sign in to comment.