taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 9ff23caa0aea46a9e47f19d2c8972400b7131efd
parent 3953a675688e73a81e5fe092dd6603815f1be208
Author: Marc Stibane <marc@taler.net>
Date:   Sun, 11 Feb 2024 17:48:05 +0100

cleanup

Diffstat:
MTalerWallet1/Controllers/PublicConstants.swift | 1-
MTalerWallet1/Views/Balances/BalancesSectionView.swift | 2+-
MTalerWallet1/Views/Banking/ExchangeSectionView.swift | 10++++++----
3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/TalerWallet1/Controllers/PublicConstants.swift b/TalerWallet1/Controllers/PublicConstants.swift @@ -44,7 +44,6 @@ public let ARS_AGE_EXCHANGE = HTTPS + "exchange-age.taler.ar" public let ARS_EXP_EXCHANGE = HTTPS + "exchange-expensive.taler.ar" public let DEMOCURRENCY = "KUDOS" public let TESTCURRENCY = "TESTKUDOS" -//public let TESTCURRENCY = "KUDOS" //public let LONGCURRENCY = "gold-pressed Latinum" // 20 characters, with dash and space public let LONGCURRENCY = "GOLDLATINUM" // 11 characters, no dash, no space diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift @@ -68,7 +68,7 @@ extension BalancesSectionView: View { .talerFont(.headline) .listRowSeparator(.hidden) } - let showSpendingButton = "KUDOS" == currency && !balance.available.isZero + let showSpendingButton = DEMOCURRENCY == currency && !balance.available.isZero if showSpendingButton { if !minimalistic && showSpendingHint { Text("You can spend these \(currencyInfo?.scope.currency ?? currency) in the Demo shop, or send them to another wallet.") diff --git a/TalerWallet1/Views/Banking/ExchangeSectionView.swift b/TalerWallet1/Views/Banking/ExchangeSectionView.swift @@ -23,9 +23,11 @@ struct ExchangeSectionView: View { // let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear #endif let scopeInfo = exchange.scopeInfo - let currency = scopeInfo?.currency ?? exchange.currency ?? "unknown" - let currencyInfo = controller.info(for: currency) - let currencyName = currencyInfo?.scope.currency ?? currency + let currency = scopeInfo?.currency + ?? exchange.currency + ?? String(localized: "Unknown", comment: "unknown currency") + let currencyInfoOpt = controller.info(for: currency) // might be nil + let currencyName = currencyInfoOpt?.scope.currency ?? currency // might be "Unknown" Section { // ForEach(exchanges) { exchange in ExchangeRowView(stack: stack.push(), @@ -34,7 +36,7 @@ struct ExchangeSectionView: View { amountToTransfer: $amountToTransfer) // does still have the wrong currency .listRowSeparator(.hidden) // } - if "KUDOS" == currency { + if DEMOCURRENCY == currency { let bankingHint = String(localized: "Since the demo bank supports the Taler integration, you can start a withdrawal directly on the") let linkTitle = String(localized: "LinkTitle_DEMOBANK", defaultValue: "Demo Bank Website") VStack {