commit 49bb0f37b18e65847d9944afcecf2838a3294b48 parent 342c19f23582f54a289921466839a3f3b464255b Author: Marc Stibane <marc@taler.net> Date: Sat, 27 Jul 2024 00:43:24 +0200 UNKNOWN Diffstat:
9 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/TalerWallet1/Controllers/PublicConstants.swift b/TalerWallet1/Controllers/PublicConstants.swift @@ -20,6 +20,9 @@ public let THIRTYDAYS: UInt = 30 // 10..30 public let EMPTYSTRING = "" // avoid automatic translation of empty "" textLiterals in Text() public let NONBREAKING: Character = "\u{00A0}" +public let UNKNOWN = String(localized: "UNKNOWN", comment: "merchant didn't specify the currency, use ALL CAPS") + + public let CONFIRM_BANK = "circle.fill" // badge in PendingRow, TransactionRow and TransactionSummary public let NEEDS_KYC = "star.fill" // badge in PendingRow, TransactionRow and TransactionSummary //public let PENDING_INCOMING = "plus.diamond" // diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift @@ -45,8 +45,8 @@ struct BalancesSectionView { @State private var transactions: [Transaction] = [] @State private var completedTransactions: [Transaction] = [] @State private var pendingTransactions: [Transaction] = [] - @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero("UNKNOWN") - @State private var currencyName: String = "UNKNOWN" + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) + @State private var currencyName: String = UNKNOWN // @State private var buttonSelected: Int? = nil private static func className() -> String {"\(self)"} diff --git a/TalerWallet1/Views/Banking/ExchangeSectionView.swift b/TalerWallet1/Views/Banking/ExchangeSectionView.swift @@ -20,6 +20,8 @@ struct ExchangeSectionView: View { @AppStorage("minimalistic") var minimalistic: Bool = false @State private var shouldReloadBalances: Int = 0 + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) + @State private var currencyName: String = UNKNOWN func amountAvailable(_ exchange: Exchange?, currency: String?) -> Amount? { if let exchange { diff --git a/TalerWallet1/Views/Overview/OverviewSectionV.swift b/TalerWallet1/Views/Overview/OverviewSectionV.swift @@ -39,6 +39,8 @@ struct OverviewSectionV { @State private var transactions: [Transaction] = [] @State private var completedTransactions: [Transaction] = [] @State private var pendingTransactions: [Transaction] = [] + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) + @State private var currencyName: String = UNKNOWN func reloadOneAction(_ transactionId: String, _ viewHandles: Bool) async throws -> Transaction { return try await model.getTransactionByIdT(transactionId, viewHandles: viewHandles) @@ -68,8 +70,8 @@ extension OverviewSectionV: View { #endif let scopeInfo = balance.scopeInfo let currency = scopeInfo.currency - let currencyInfo = controller.info(for: currency, controller.currencyTicker) - let currencyName = currencyInfo.scope.currency +// let currencyInfo = controller.info(for: currency, controller.currencyTicker) +// let currencyName = currencyInfo.scope.currency Section { if scopeInfo.type == .exchange { diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -21,6 +21,7 @@ struct P2pPayURIView: View { @Environment(\.colorSchemeContrast) private var colorSchemeContrast @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) @State private var peerPullDebitResponse: PreparePeerPullDebitResponse? let navTitle = String(localized: "Pay P2P", comment: "Nav Title") diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -22,6 +22,7 @@ struct P2pReceiveURIView: View { @Environment(\.colorSchemeContrast) private var colorSchemeContrast @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) @State private var peerPushCreditResponse: PreparePeerPushCreditResponse? = nil @State private var exchange: Exchange? = nil diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift @@ -40,6 +40,7 @@ struct PayTemplateV: View { @State private var summary: String = EMPTYSTRING // templateParam @State private var feeAmount: Amount? = nil + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) // @State private var feeStr: String = EMPTYSTRING private func shortcutAction(_ shortcut: Amount) { diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -39,7 +39,7 @@ struct WithdrawURIView: View { @State private var exchange: Exchange? = nil @State private var possibleExchanges: [Exchange] = [] @State private var defaultExchangeBaseUrl: String? // if nil then use possibleExchanges - @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero("UNKNOWN") + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) @State private var feeAmount: Amount? = nil diff --git a/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift b/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift @@ -19,6 +19,7 @@ struct WithdrawExchangeV: View { @EnvironmentObject private var model: WalletModel @State private var amountToTransfer = Amount.zero(currency: "") @State private var exchange: Exchange? = nil + @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) var body: some View { #if PRINT_CHANGES