Skip to content

Commit ebcb698

Browse files
fix: fix panic deleting file sync session via right click (#202)
Also configures the linter to pick up on unused arguments, and configures the formatter to not format them out (by setting them to _). If this was the case prior, this bug wouldn't have happened.
1 parent ff0bea0 commit ebcb698

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Coder-Desktop/.swiftformat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
--selfrequired log,info,error,debug,critical,fault
22
--exclude **.pb.swift,**.grpc.swift
3-
--condassignment always
3+
--condassignment always
4+
--disable unusedArguments

Coder-Desktop/.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ disabled_rules:
33
- trailing_comma
44
- blanket_disable_command # Used by Protobuf
55
- opening_brace # Handled by SwiftFormat
6+
opt_in_rules:
7+
- unused_parameter
68
type_name:
79
allowed_symbols: "_"
810
identifier_name:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ struct FileSyncConfig<VPN: VPNService, FS: FileSyncDaemon>: View {
165165
}
166166

167167
// TODO: Support selecting & deleting multiple sessions at once
168-
func delete(session _: FileSyncSession) async {
168+
func delete(session: FileSyncSession) async {
169169
loading = true
170170
defer { loading = false }
171171
do throws(DaemonError) {
172-
try await fileSync.deleteSessions(ids: [selection!])
172+
try await fileSync.deleteSessions(ids: [session.id])
173173
} catch {
174174
actionError = error
175175
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy