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

Commit 6d24f0c

Browse files
authored
Fix another bug :|
1 parent cef34bf commit 6d24f0c

1 file changed

Lines changed: 24 additions & 31 deletions

File tree

Sources/prostore/views/appsView.swift

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct AltApp: Decodable, Identifiable {
2727
let iconURL: URL?
2828
let localizedDescription: String?
2929
let versions: [AppVersion]?
30+
let screenshotURLs: [URL]?
3031
}
3132

3233
// MARK: - ViewModel
@@ -284,13 +285,13 @@ private struct AppDetailView: View {
284285
var body: some View {
285286
ScrollView {
286287
VStack(alignment: .leading, spacing: 16) {
288+
289+
// App Header
287290
HStack(alignment: .top, spacing: 16) {
288291
if let iconURL = app.iconURL {
289292
AsyncImage(url: iconURL) { phase in
290293
switch phase {
291-
case .empty:
292-
ProgressView()
293-
.frame(width: 80, height: 80)
294+
case .empty: ProgressView().frame(width: 80, height: 80)
294295
case .success(let image):
295296
image
296297
.resizable()
@@ -303,8 +304,7 @@ private struct AppDetailView: View {
303304
.scaledToFit()
304305
.frame(width: 60, height: 60)
305306
.foregroundColor(.secondary)
306-
@unknown default:
307-
EmptyView()
307+
@unknown default: EmptyView()
308308
}
309309
}
310310
}
@@ -323,47 +323,36 @@ private struct AppDetailView: View {
323323
}
324324
}
325325

326+
// General description
326327
if let generalDesc = app.localizedDescription, generalDesc != latestVersion?.localizedDescription {
327328
Text(generalDesc)
328329
}
329330

330-
if let latest = latestVersion, latest.localizedDescription != nil, latest.localizedDescription != app.localizedDescription {
331+
// What's New
332+
if let latest = latestVersion, let latestDesc = latest.localizedDescription,
333+
latestDesc != app.localizedDescription {
331334
VStack(alignment: .leading, spacing: 8) {
332335
Text("What's New?")
333336
.font(.headline)
334-
Text(latest.localizedDescription!)
337+
Text(latestDesc)
335338
}
336339
}
337340

341+
// Version info
338342
if let latest = latestVersion {
339343
VStack(alignment: .leading, spacing: 4) {
340-
HStack {
341-
Text("Version:")
342-
.bold()
343-
Text(latest.version ?? "Unknown")
344-
}
345-
HStack {
346-
Text("Released:")
347-
.bold()
348-
Text(formatDate(latest.date))
349-
}
350-
HStack {
351-
Text("Size:")
352-
.bold()
353-
Text(formatSize(latest.size))
354-
}
355-
HStack {
356-
Text("Min OS:")
357-
.bold()
358-
Text(latest.minOSVersion ?? "Unknown")
359-
}
344+
HStack { Text("Version:").bold(); Text(latest.version ?? "Unknown") }
345+
HStack { Text("Released:").bold(); Text(formatDate(latest.date)) }
346+
HStack { Text("Size:").bold(); Text(formatSize(latest.size)) }
347+
HStack { Text("Min OS:").bold(); Text(latest.minOSVersion ?? "Unknown") }
360348
}
361349
}
362350

363-
if let screenshots = latestVersion?.screenshotURLs, !screenshots.isEmpty {
351+
// Screenshots (from general app)
352+
if let screenshots = app.screenshotURLs, !screenshots.isEmpty {
364353
ScrollView(.horizontal, showsIndicators: false) {
365-
HStack {
366-
ForEach(screenshots!, id: \.self) { url in
354+
HStack(spacing: 12) {
355+
ForEach(screenshots, id: \.self) { url in
367356
AsyncImage(url: url) { phase in
368357
switch phase {
369358
case .empty: ProgressView()
@@ -373,7 +362,11 @@ private struct AppDetailView: View {
373362
.scaledToFit()
374363
.frame(height: 200)
375364
.cornerRadius(10)
376-
case .failure: Image(systemName: "photo").resizable().scaledToFit().frame(height: 200)
365+
case .failure:
366+
Image(systemName: "photo")
367+
.resizable()
368+
.scaledToFit()
369+
.frame(height: 200)
377370
@unknown default: EmptyView()
378371
}
379372
}

0 commit comments

Comments
 (0)