@@ -8,7 +8,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
8
8
@EnvironmentObject private var fileSync : FS
9
9
10
10
@State private var localPath : String = " "
11
- @State private var remoteHostName : String ?
11
+ @State private var remoteHostname : String ?
12
12
@State private var remotePath : String = " "
13
13
14
14
@State private var loading : Bool = false
@@ -37,7 +37,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
37
37
}
38
38
}
39
39
Section {
40
- Picker ( " Workspace " , selection: $remoteHostName ) {
40
+ Picker ( " Workspace " , selection: $remoteHostname ) {
41
41
ForEach ( agents, id: \. id) { agent in
42
42
Text ( agent. primaryHost!) . tag ( agent. primaryHost!)
43
43
}
@@ -55,16 +55,16 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
55
55
Button ( " Cancel " , action: { dismiss ( ) } ) . keyboardShortcut ( . cancelAction)
56
56
Button ( existingSession == nil ? " Add " : " Save " ) { Task { await submit ( ) } }
57
57
. keyboardShortcut ( . defaultAction)
58
- . disabled ( localPath. isEmpty || remotePath. isEmpty || remoteHostName == nil )
58
+ . disabled ( localPath. isEmpty || remotePath. isEmpty || remoteHostname == nil )
59
59
} . padding ( 20 )
60
60
} . onAppear {
61
61
if let existingSession {
62
62
localPath = existingSession. alphaPath
63
- remoteHostName = agents. first { $0. primaryHost == existingSession. agentHost } ? . primaryHost
63
+ remoteHostname = agents. first { $0. primaryHost == existingSession. agentHost } ? . primaryHost
64
64
remotePath = existingSession. betaPath
65
65
} else {
66
66
// Set the picker to the first agent by default
67
- remoteHostName = agents. first? . primaryHost
67
+ remoteHostname = agents. first? . primaryHost
68
68
}
69
69
} . disabled ( loading)
70
70
. alert ( " Error " , isPresented: Binding (
@@ -77,7 +77,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
77
77
78
78
func submit( ) async {
79
79
createError = nil
80
- guard let remoteHostName else {
80
+ guard let remoteHostname else {
81
81
return
82
82
}
83
83
loading = true
@@ -88,7 +88,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
88
88
}
89
89
try await fileSync. createSession (
90
90
localPath: localPath,
91
- agentHost: remoteHostName ,
91
+ agentHost: remoteHostname ,
92
92
remotePath: remotePath
93
93
)
94
94
} catch {
0 commit comments