@@ -10,17 +10,43 @@ struct VPNState<VPN: VPNService>: View {
10
10
Group {
11
11
switch ( vpn. state, state. hasSession) {
12
12
case ( . failed( . systemExtensionError( . needsUserApproval) ) , _) :
13
- Text ( " Awaiting System Extension approval " )
14
- . font ( . body)
15
- . foregroundStyle ( . secondary)
13
+ VStack {
14
+ Text ( " Awaiting System Extension approval " )
15
+ . foregroundColor ( . secondary)
16
+ . multilineTextAlignment ( . center)
17
+ . fixedSize ( horizontal: false , vertical: true )
18
+ . padding ( . horizontal, Theme . Size. trayInset)
19
+ . padding ( . vertical, Theme . Size. trayPadding)
20
+ . frame ( maxWidth: . infinity)
21
+ Button {
22
+ openSystemExtensionSettings ( )
23
+ } label: {
24
+ Text ( " Approve in System Settings " )
25
+ }
26
+ }
16
27
case ( _, false ) :
17
28
Text ( " Sign in to use Coder Desktop " )
18
29
. font ( . body)
19
30
. foregroundColor ( . secondary)
20
31
case ( . failed( . networkExtensionError( . unconfigured) ) , _) :
21
- Text ( " The system VPN requires reconfiguration. " )
22
- . font ( . body)
23
- . foregroundStyle ( . secondary)
32
+ VStack {
33
+ Text ( " The system VPN requires reconfiguration " )
34
+ . foregroundColor ( . secondary)
35
+ . multilineTextAlignment ( . center)
36
+ . fixedSize ( horizontal: false , vertical: true )
37
+ . padding ( . horizontal, Theme . Size. trayInset)
38
+ . padding ( . vertical, Theme . Size. trayPadding)
39
+ . frame ( maxWidth: . infinity)
40
+ Button {
41
+ state. reconfigure ( )
42
+ } label: {
43
+ Text ( " Reconfigure VPN " )
44
+ }
45
+ } . onAppear {
46
+ // Show the prompt onAppear, so the user doesn't have to
47
+ // open the menu bar an extra time
48
+ state. reconfigure ( )
49
+ }
24
50
case ( . disabled, _) :
25
51
Text ( " Enable Coder Connect to see workspaces " )
26
52
. font ( . body)
0 commit comments