Commit 6fa43a3d81

6fa43a3d81440242a647c235bf3a7f9fbc11426c

parent: 15d73b1f0d

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-25 23:52 UTC

orgstar+ screen: error and retry instead of a spinner

The plans show a spinner only while they load. When the App Store can't be
reached, or some plans are missing, the error shows in their place with
Try Again, as the tip section does.

Ref #222

Layout: unified · split

Sources/OrgstarMobile/ProScreen.swift +9 −3 · view
@@ -66,10 +66,13 @@ struct ProScreen: View {
66 } footer: { 66 } footer: {
67 Text("Editing, the agenda, capture, clocking, tables and search stay free.") 67 Text("Editing, the agenda, capture, clocking, tables and search stay free.")
68 } 68 }
69 if access.grant != .grandfathered, store.activeProductID != ProStore.lifetime { 69 if showsPlans {
70 Section { 70 Section {
71 if store.products.isEmpty { 71 if store.isLoading && store.products.isEmpty {
72 ProgressView().frame(maxWidth: .infinity) 72 ProgressView().frame(maxWidth: .infinity)
73 } else if store.products.count < ProStore.productIDs.count, let message = store.message {
74 Text(message).foregroundStyle(.secondary)
75 Button("Try Again") { Task { await store.loadProducts() } }
73 } 76 }
74 ForEach(store.products) { product in 77 ForEach(store.products) { product in
75 Button { Task { await store.buy(product) } } label: { plan(product) } 78 Button { Task { await store.buy(product) } } label: { plan(product) }
@@ -90,7 +93,8 @@ struct ProScreen: View {
90 Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!) 93 Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
91 Link("Privacy Policy", destination: URL(string: "https://krz.sh/privacy/orgstar/")!) 94 Link("Privacy Policy", destination: URL(string: "https://krz.sh/privacy/orgstar/")!)
92 } 95 }
93 if let message = store.message { 96 // A purchase's or restore's message; a failed load shows under the plans.
97 if let message = store.message, !showsPlans || store.products.count == ProStore.productIDs.count {
94 Section { Text(message).foregroundStyle(.secondary) } 98 Section { Text(message).foregroundStyle(.secondary) }
95 } 99 }
96 } 100 }
@@ -100,6 +104,8 @@ struct ProScreen: View {
100 .task { await store.loadProducts() } 104 .task { await store.loadProducts() }
101 } 105 }
102 106
107 private var showsPlans: Bool { access.grant != .grandfathered && store.activeProductID != ProStore.lifetime }
108
103 /// One plan: its name, an optional savings tag, what it bills, and its price. 109 /// One plan: its name, an optional savings tag, what it bills, and its price.
104 private func plan(_ product: Product) -> some View { 110 private func plan(_ product: Product) -> some View {
105 HStack(alignment: .firstTextBaseline) { 111 HStack(alignment: .firstTextBaseline) {
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form