ios, android: drop the body text from the checking screen; core: clarify the unpaid record bound

This commit is contained in:
spaced4ndy
2026-10-05 13:49:47 +04:00
parent c3629d0266
commit 3696ec1d7f
6 changed files with 20 additions and 17 deletions
@@ -12,7 +12,7 @@ struct BadgesPurchaseStateView: View {
@EnvironmentObject var theme: AppTheme
@Environment(\.dismiss) private var dismiss
let title: LocalizedStringKey
let message: LocalizedStringKey
var message: LocalizedStringKey? = nil
var showsAsSheet: Bool = false
var body: some View {
@@ -38,10 +38,12 @@ struct BadgesPurchaseStateView: View {
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
Text(message)
.font(.body)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
if let message {
Text(message)
.font(.body)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
}
Spacer()
@@ -31,7 +31,7 @@ struct BadgesView: View {
BadgesPurchaseStateView(title: purchaseState.title, message: purchaseState.message, showsAsSheet: showsAsSheet)
.transition(.opacity)
} else if store.checkingPurchases {
BadgesPurchaseStateView(title: "Checking your purchases", message: "Purchases not yet delivered are checked first.", showsAsSheet: showsAsSheet)
BadgesPurchaseStateView(title: "Checking your purchases", showsAsSheet: showsAsSheet)
.transition(.opacity)
} else {
BadgesSupportSimplexView(showsAsSheet: showsAsSheet)
@@ -16,7 +16,7 @@ import chat.simplex.common.views.onboarding.TextButtonBelowOnboardingButton
import chat.simplex.res.MR
@Composable
fun BadgesPurchaseStateView(title: StringResource, message: StringResource, onDismiss: () -> Unit) {
fun BadgesPurchaseStateView(title: StringResource, message: StringResource?, onDismiss: () -> Unit) {
ColumnWithScrollBar(
Modifier.background(MaterialTheme.colors.background).padding(horizontal = 25.dp).padding(top = 8.dp, bottom = 20.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
@@ -32,12 +32,14 @@ fun BadgesPurchaseStateView(title: StringResource, message: StringResource, onDi
modifier = Modifier.fillMaxWidth()
)
Text(
stringResource(message),
style = MaterialTheme.typography.body1,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth()
)
if (message != null) {
Text(
stringResource(message),
style = MaterialTheme.typography.body1,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth()
)
}
Spacer(Modifier.weight(1f))
@@ -30,7 +30,7 @@ fun BadgesView(modalManager: ModalManager, close: () -> Unit) {
// holds the purchase screens' slot, so a consumable cannot be bought twice
BadgesPurchaseStateView(purchaseState.title, purchaseState.message, onDismiss = close)
} else if (checkingPurchases) {
BadgesPurchaseStateView(MR.strings.badges_checking_purchases_title, MR.strings.badges_checking_purchases_body, onDismiss = close)
BadgesPurchaseStateView(MR.strings.badges_checking_purchases_title, null, onDismiss = close)
} else {
BadgesSupportSimplexView(modalManager, unwindToDepth)
}
@@ -3190,7 +3190,6 @@
<string name="badges_waiting_for_approval_title">Waiting for approval</string>
<string name="badges_waiting_for_approval_body">Nothing has been charged.</string>
<string name="badges_checking_purchases_title">Checking your purchases</string>
<string name="badges_checking_purchases_body">Purchases not yet delivered are checked first.</string>
<string name="badges_store_purchase_title">Store purchase</string>
<string name="badges_store_purchase_processing">A store purchase is being processed.</string>
<string name="badges_buy_in_browser">Buy in browser</string>
+2 -2
View File
@@ -143,8 +143,8 @@ getOpenStorePurchases db User {userId} now =
|]
(userId, receiptDueSince)
where
-- a week outlasts an Ask to Buy request (24 hours) and a Play slow payment (days), whose waiting screen
-- needs the record; one a receipt reached is paid for, so it is listed until its badge arrives
-- a record with no receipt is dropped after a week: longer than an Ask to Buy approval or a Play slow
-- payment can take, and those are the only waits that still need it. One a receipt reached is paid for.
receiptDueSince = addUTCTime (negate $ 7 * nominalDay) now
getBadgeStoreReceipt :: DB.Connection -> User -> StoreTransactionRef -> IO (Maybe BadgeStash)