File tree 3 files changed +16
-12
lines changed 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ struct VPNProgressView: View {
13
13
var body : some View {
14
14
VStack {
15
15
CircularProgressView ( value: value)
16
- // We'll estimate that the last 25% takes 9 seconds
16
+ // We estimate that the last half takes 8 seconds
17
17
// so it doesn't appear stuck
18
- . autoComplete ( threshold: 0.75 , duration: 9 )
18
+ . autoComplete ( threshold: 0.5 , duration: 8 )
19
19
Text ( progressMessage)
20
20
. multilineTextAlignment ( . center)
21
21
}
@@ -42,7 +42,7 @@ struct VPNProgressView: View {
42
42
}
43
43
switch progress. stage {
44
44
case . initial:
45
- return 0.10
45
+ return 0.05
46
46
case . downloading:
47
47
guard let downloadProgress = progress. downloadProgress else {
48
48
// We can't make this illegal state unrepresentable because XPC
@@ -52,17 +52,17 @@ struct VPNProgressView: View {
52
52
// 40MB if the server doesn't give us the expected size
53
53
let totalBytes = downloadProgress. totalBytesToWrite ?? 40_000_000
54
54
let downloadPercent = min ( 1.0 , Float ( downloadProgress. totalBytesWritten) / Float( totalBytes) )
55
- return 0.10 + 0.6 * downloadPercent
55
+ return 0.05 + 0.4 * downloadPercent
56
56
case . validating:
57
- return 0.71
57
+ return 0.42
58
58
case . removingQuarantine:
59
- return 0.72
59
+ return 0.44
60
60
case . opening:
61
- return 0.73
61
+ return 0.46
62
62
case . settingUpTunnel:
63
- return 0.74
63
+ return 0.48
64
64
case . startingTunnel:
65
- return 0.75
65
+ return 0.50
66
66
}
67
67
}
68
68
}
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ struct Agents<VPN: VPNService>: View {
33
33
if hasToggledExpansion {
34
34
return
35
35
}
36
- expandedItem = visibleItems. first? . id
36
+ withAnimation ( . snappy( duration: Theme . Animation. collapsibleDuration) ) {
37
+ expandedItem = visibleItems. first? . id
38
+ }
37
39
hasToggledExpansion = true
38
40
}
39
41
if items. count == 0 {
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ extension DownloadManager: URLSessionDownloadDelegate {
238
238
try FileManager . default. moveItem ( at: location, to: dest)
239
239
} catch {
240
240
continuation. resume ( throwing: DownloadError . fileOpError ( error) )
241
+ return
241
242
}
242
243
243
244
continuation. resume ( )
@@ -278,7 +279,8 @@ extension DownloadManager: URLSessionDownloadDelegate {
278
279
override public var description : String {
279
280
let fmt = ByteCountFormatter ( )
280
281
let done = fmt. string ( fromByteCount: totalBytesWritten)
281
- let tot = totalBytesToWrite. map { fmt. string ( fromByteCount: $0) } ?? " Unknown "
282
- return " \( done) / \( tot) "
282
+ . padding ( toLength: 7 , withPad: " " , startingAt: 0 )
283
+ let total = totalBytesToWrite. map { fmt. string ( fromByteCount: $0) } ?? " Unknown "
284
+ return " \( done) / \( total) "
283
285
}
284
286
}
You can’t perform that action at this time.
0 commit comments