Fix compile errors: guard unwrap + ViewBuilder var mutation
Build iOS App / Build .ipa and publish source (push) Successful in 25s

- PRDetailView: guard let current = selectedTab ?? .overview fails because
  ?? already unwraps to non-optional. Use let current = selectedTab ?? .overview.
- MarkdownText: var inCodeBlock inside ViewBuilder is not allowed. Precompute
  lines with their code-block state as a computed property on a private struct,
  then iterate via ForEach in the builder. Bump to 3.3.
This commit is contained in:
Hermes committed 2026-08-14 09:45:44 +00:00
1 parent dd0fc84238
commit a9d408ee85
2 files changed
+58 -32

No files matched your search

+2 -2
View File
@@ -195,8 +195,8 @@ struct PRDetailView: View {
DragGesture(minimumDistance: 20)
.onEnded { value in
let tabs = DetailTab.allCases
guard let current = selectedTab ?? .overview,
let idx = tabs.firstIndex(of: current) else { return }
let current = selectedTab ?? .overview
guard let idx = tabs.firstIndex(of: current) else { return }
if value.translation.width < -40, idx < tabs.count - 1 {
withAnimation { selectedTab = tabs[idx + 1] }
} else if value.translation.width > 40, idx > 0 {