Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit bf23d22

Browse files
authored
Update AppsDetailView.swift
1 parent c63c144 commit bf23d22

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

Sources/prostore/views/AppsDetailView.swift

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,20 @@ public struct AppDetailView: View {
229229
VStack(spacing: 8) {
230230
HStack {
231231
ProgressView(value: downloadManager.progress, total: 1.0)
232-
.progressViewStyle(LinearProgressViewStyle(tint: downloadManager.showSuccess ? .green : .blue))
232+
.progressViewStyle(LinearProgressViewStyle(
233+
tint: downloadManager.showSuccess ? .green :
234+
(downloadManager.showError ? .red : .blue)
235+
))
233236
.scaleEffect(x: 1, y: 1.5, anchor: .center)
234237

235238
if downloadManager.showSuccess {
236239
Image(systemName: "checkmark.circle.fill")
237240
.foregroundColor(.green)
238241
.font(.title2)
242+
} else if downloadManager.showError {
243+
Image(systemName: "xmark.circle.fill")
244+
.foregroundColor(.red)
245+
.font(.title2)
239246
} else {
240247
Text("\(Int(downloadManager.progress * 100))%")
241248
.font(.caption)
@@ -247,13 +254,16 @@ public struct AppDetailView: View {
247254
HStack {
248255
Text(downloadManager.status)
249256
.font(.caption)
250-
.foregroundColor(downloadManager.showSuccess ? .green : .secondary)
251-
.lineLimit(1)
252-
.truncationMode(.middle)
257+
.foregroundColor(
258+
downloadManager.showSuccess ? .green :
259+
(downloadManager.showError ? .red : .secondary)
260+
)
261+
.lineLimit(2) // Allow 2 lines for error messages
262+
.truncationMode(.tail)
253263

254264
Spacer()
255265

256-
if !downloadManager.showSuccess {
266+
if !downloadManager.showSuccess && !downloadManager.showError {
257267
Button("Cancel") {
258268
downloadManager.cancel()
259269
}
@@ -292,5 +302,6 @@ public struct AppDetailView: View {
292302
}
293303
.animation(.easeInOut(duration: 0.3), value: downloadManager.isProcessing)
294304
.animation(.easeInOut(duration: 0.3), value: downloadManager.showSuccess)
305+
.animation(.easeInOut(duration: 0.3), value: downloadManager.showError)
295306
}
296307
}

0 commit comments

Comments
 (0)