Skip to content

Commit 3c12680

Browse files
committed
review
1 parent 0997c9d commit 3c12680

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncSessionModal.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
88
@EnvironmentObject private var fileSync: FS
99

1010
@State private var localPath: String = ""
11-
@State private var chosenAgent: String?
11+
@State private var remoteHostName: String?
1212
@State private var remotePath: String = ""
1313

1414
@State private var loading: Bool = false
@@ -37,7 +37,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
3737
}
3838
}
3939
Section {
40-
Picker("Workspace", selection: $chosenAgent) {
40+
Picker("Workspace", selection: $remoteHostName) {
4141
ForEach(agents, id: \.id) { agent in
4242
Text(agent.primaryHost!).tag(agent.primaryHost!)
4343
}
@@ -55,16 +55,16 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
5555
Button("Cancel", action: { dismiss() }).keyboardShortcut(.cancelAction)
5656
Button(existingSession == nil ? "Add" : "Save") { Task { await submit() }}
5757
.keyboardShortcut(.defaultAction)
58-
.disabled(localPath.isEmpty || remotePath.isEmpty || chosenAgent == nil)
58+
.disabled(localPath.isEmpty || remotePath.isEmpty || remoteHostName == nil)
5959
}.padding(20)
6060
}.onAppear {
6161
if let existingSession {
6262
localPath = existingSession.alphaPath
63-
chosenAgent = agents.first { $0.primaryHost == existingSession.agentHost }?.primaryHost
63+
remoteHostName = agents.first { $0.primaryHost == existingSession.agentHost }?.primaryHost
6464
remotePath = existingSession.betaPath
6565
} else {
6666
// Set the picker to the first agent by default
67-
chosenAgent = agents.first?.primaryHost
67+
remoteHostName = agents.first?.primaryHost
6868
}
6969
}.disabled(loading)
7070
.alert("Error", isPresented: Binding(
@@ -77,7 +77,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
7777

7878
func submit() async {
7979
createError = nil
80-
guard let chosenAgent else {
80+
guard let remoteHostName else {
8181
return
8282
}
8383
loading = true
@@ -88,7 +88,7 @@ struct FileSyncSessionModal<VPN: VPNService, FS: FileSyncDaemon>: View {
8888
}
8989
try await fileSync.createSession(
9090
localPath: localPath,
91-
agentHost: chosenAgent,
91+
agentHost: remoteHostName,
9292
remotePath: remotePath
9393
)
9494
} catch {

0 commit comments

Comments
 (0)