File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,15 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
117
117
}
118
118
119
119
private var vpnDisabled : Bool {
120
- vpn. state == . connecting ||
121
- vpn. state == . disconnecting ||
122
- // Prevent starting the VPN before the user has approved the system extension.
123
- vpn. state == . failed( . systemExtensionError( . needsUserApproval) ) ||
124
- // Prevent starting the VPN without a VPN configuration.
125
- vpn. state == . failed( . networkExtensionError( . unconfigured) )
120
+ // Always enabled if signed out, as that will open the sign in window
121
+ state. hasSession && (
122
+ vpn. state == . connecting ||
123
+ vpn. state == . disconnecting ||
124
+ // Prevent starting the VPN before the user has approved the system extension.
125
+ vpn. state == . failed( . systemExtensionError( . needsUserApproval) ) ||
126
+ // Prevent starting the VPN without a VPN configuration.
127
+ vpn. state == . failed( . networkExtensionError( . unconfigured) )
128
+ )
126
129
}
127
130
}
128
131
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ struct VPNMenuTests {
59
59
@Test
60
60
func testVPNDisabledWhileConnecting( ) async throws {
61
61
vpn. state = . disabled
62
+ state. login ( baseAccessURL: URL ( string: " https://coder.example.com " ) !, sessionToken: " fake-token " )
62
63
63
64
try await ViewHosting . host ( view) {
64
65
try await sut. inspection. inspect { view in
@@ -79,6 +80,7 @@ struct VPNMenuTests {
79
80
@Test
80
81
func testVPNDisabledWhileDisconnecting( ) async throws {
81
82
vpn. state = . disabled
83
+ state. login ( baseAccessURL: URL ( string: " https://coder.example.com " ) !, sessionToken: " fake-token " )
82
84
83
85
try await ViewHosting . host ( view) {
84
86
try await sut. inspection. inspect { view in
You can’t perform that action at this time.
0 commit comments