commit 33421ae5b1ec579a40b8e355356e0b8e74878c48 parent ca158ae7a3f2205ed1ed7ded241e07a6dc83a277 Author: Marc Stibane <marc@taler.net> Date: Fri, 24 May 2024 08:24:14 +0200 localizedState Diffstat:
5 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -41,7 +41,7 @@ struct P2pPayURIView: View { large: false, pending: false, incoming: false, baseURL: nil, noFees: nil, // TODO: check baseURL for fees - status: nil, + txStateLcl: nil, summary: peerPullDebitResponse.contractTerms.summary, merchant: nil) let expiration = peerPullDebitResponse.contractTerms.purse_expiration diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -50,7 +50,7 @@ struct P2pReceiveURIView: View { large: false, pending: false, incoming: true, baseURL: nil, noFees: nil, // TODO: check baseURL for fees - status: nil, + txStateLcl: nil, summary: peerPushCreditResponse.contractTerms.summary, merchant: nil) let expiration = peerPushCreditResponse.contractTerms.purse_expiration diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -50,7 +50,7 @@ struct PaymentView: View { large: false, pending: false, incoming: false, baseURL: baseURL, noFees: nil, // TODO: check baseURL for fees - status: nil, + txStateLcl: nil, summary: terms.summary, merchant: terms.merchant.name) // TODO: payment: popup with all possible exchanges, check fees @@ -67,7 +67,7 @@ struct PaymentView: View { large: false, pending: false, incoming: false, baseURL: baseURL, noFees: nil, // TODO: check baseURL for fees - status: nil, + txStateLcl: nil, summary: terms.summary, merchant: terms.merchant.name) } else { diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -56,7 +56,7 @@ struct WithdrawURIView: View { large: false, pending: false, incoming: true, baseURL: exchange.exchangeBaseUrl, noFees: exchange.noFees, - status: nil, // common.txState.major.localizedState + txStateLcl: nil, // common.txState.major.localizedState summary: nil, merchant: nil) let someCoins = SomeCoins(details: withdrawalAmountDetails) diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift @@ -18,6 +18,12 @@ struct ThreeAmountsSheet: View { let summary: String? let merchant: String? +#if DEBUG + @AppStorage("developerMode") var developerMode: Bool = true +#else + @AppStorage("developerMode") var developerMode: Bool = false +#endif + var body: some View { let raw = common.amountRaw let effective = common.amountEffective @@ -35,6 +41,9 @@ struct ThreeAmountsSheet: View { : String(localized: "Obtained:", comment: "mini") ) : (pending ? String(localized: "Pay:", comment: "mini") : String(localized: "Paid:", comment: "mini") ) + let majorLcl = common.txState.major.localizedState + let txStateLcl = developerMode && pending ? (common.txState.minor?.localizedState ?? majorLcl) + : majorLcl ThreeAmountsV(stack: stack.push(), topTitle: topTitle, topAbbrev: topAbbrev, topAmount: raw, fee: fee, @@ -44,7 +53,7 @@ struct ThreeAmountsSheet: View { large: large, pending: pending, incoming: incoming, baseURL: baseURL, noFees: noFees, - status: common.txState.major.localizedState, + txStateLcl: txStateLcl, summary: summary, merchant: merchant) } @@ -64,7 +73,7 @@ struct ThreeAmountsV: View { let incoming: Bool let baseURL: String? let noFees: Bool? // true if exchange charges no fees at all - let status: String? + let txStateLcl: String? // localizedState let summary: String? let merchant: String?