Skip to content

Commit 1950779

Browse files
committed
remove max size
1 parent 97b461f commit 1950779

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct FileSyncConfig<VPN: VPNService, FS: FileSyncDaemon>: View {
2424
.width(min: 100, ideal: 120)
2525
TableColumn("Status") { $0.status.column.help($0.statusAndErrors) }
2626
.width(min: 80, ideal: 100)
27-
TableColumn("Size") { Text($0.maxSize.humanSizeBytes).help($0.sizeDescription) }
27+
TableColumn("Size") { Text($0.localSize.humanSizeBytes).help($0.sizeDescription) }
2828
.width(min: 60, ideal: 80)
2929
}
3030
.contextMenu(forSelectionType: FileSyncSession.ID.self, menu: { _ in },

Coder-Desktop/VPNLib/FileSync/FileSyncSession.swift

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ public struct FileSyncSession: Identifiable {
99
public let betaPath: String
1010
public let status: FileSyncStatus
1111

12-
public let maxSize: FileSyncSessionEndpointSize
1312
public let localSize: FileSyncSessionEndpointSize
1413
public let remoteSize: FileSyncSessionEndpointSize
1514

@@ -25,14 +24,14 @@ public struct FileSyncSession: Identifiable {
2524
} else {
2625
"Unknown"
2726
}
28-
if state.session.beta.protocol == Url_Protocol.ssh, !state.session.beta.host.isEmpty {
27+
agentHost = if state.session.beta.protocol == Url_Protocol.ssh, !state.session.beta.host.isEmpty {
2928
// TOOD: We need to either:
3029
// - make this compatible with custom suffixes
3130
// - always strip the tld
3231
// - always keep the tld
33-
agentHost = state.session.beta.host
32+
state.session.beta.host
3433
} else {
35-
agentHost = "Unknown"
34+
"Unknown"
3635
}
3736
betaPath = if !state.session.beta.path.isEmpty {
3837
state.session.beta.path
@@ -64,7 +63,6 @@ public struct FileSyncSession: Identifiable {
6463
dirCount: state.betaState.directories,
6564
symLinkCount: state.betaState.symbolicLinks
6665
)
67-
maxSize = localSize.maxOf(other: remoteSize)
6866

6967
errors = accumulateErrors(from: state)
7068
}
@@ -77,9 +75,6 @@ public struct FileSyncSession: Identifiable {
7775

7876
public var sizeDescription: String {
7977
var out = ""
80-
if localSize != remoteSize {
81-
out += "Maximum:\n\(maxSize.description(linePrefix: " "))\n\n"
82-
}
8378
out += "Local:\n\(localSize.description(linePrefix: " "))\n\n"
8479
out += "Remote:\n\(remoteSize.description(linePrefix: " "))"
8580
return out
@@ -99,15 +94,6 @@ public struct FileSyncSessionEndpointSize: Equatable {
9994
self.symLinkCount = symLinkCount
10095
}
10196

102-
func maxOf(other: FileSyncSessionEndpointSize) -> FileSyncSessionEndpointSize {
103-
FileSyncSessionEndpointSize(
104-
sizeBytes: max(sizeBytes, other.sizeBytes),
105-
fileCount: max(fileCount, other.fileCount),
106-
dirCount: max(dirCount, other.dirCount),
107-
symLinkCount: max(symLinkCount, other.symLinkCount)
108-
)
109-
}
110-
11197
public var humanSizeBytes: String {
11298
humanReadableBytes(sizeBytes)
11399
}

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