diff options
author | Marc Stibane <marc@taler.net> | 2024-01-18 00:59:05 +0100 |
---|---|---|
committer | Marc Stibane <marc@taler.net> | 2024-01-18 01:07:03 +0100 |
commit | fa377b5ca34c21f287994999f5db5b7e7f861ca4 (patch) | |
tree | e33ff3237a9186ef400180ca53f9dece8877ab5c | |
parent | 20225fb5c04da51927e043f384d97ded6d370911 (diff) | |
download | taler-ios-fa377b5ca34c21f287994999f5db5b7e7f861ca4.tar.gz taler-ios-fa377b5ca34c21f287994999f5db5b7e7f861ca4.tar.bz2 taler-ios-fa377b5ca34c21f287994999f5db5b7e7f861ca4.zip |
use scopeInfo
4 files changed, 12 insertions, 7 deletions
diff --git a/TalerWallet1/Views/Banking/ExchangeListView.swift b/TalerWallet1/Views/Banking/ExchangeListView.swift index aa5c261..718291f 100644 --- a/TalerWallet1/Views/Banking/ExchangeListView.swift +++ b/TalerWallet1/Views/Banking/ExchangeListView.swift @@ -120,7 +120,8 @@ extension ExchangeListCommonV { var currencies: [String : [Exchange]] = [:] for exchange in exchanges { - let currency = exchange.currency ?? "Unknown" + let currency = exchange.scopeInfo?.currency + ?? exchange.currency ?? "Unknown" if currencies[currency] != nil { currencies[currency]!.append(exchange) } else { diff --git a/TalerWallet1/Views/Banking/ExchangeRowView.swift b/TalerWallet1/Views/Banking/ExchangeRowView.swift index 59c76de..a16e6ad 100644 --- a/TalerWallet1/Views/Banking/ExchangeRowView.swift +++ b/TalerWallet1/Views/Banking/ExchangeRowView.swift @@ -105,7 +105,8 @@ struct ExchangeRowView: View { if controller.hasInfo(for: currency) == nil { symLog.log("fetching info for \(currency)") // FIXME: remove fake ScopeInfo once the REAL one is in exchange.scopeInfo - let scopeInfo = exchange.scopeInfo ?? ScopeInfo(type: .global, currency: currency) + let scopeInfo = exchange.scopeInfo + ?? ScopeInfo(type: .global, currency: currency) do { let info = try await model.getCurrencyInfoM(scope: scopeInfo, delay: delay) // logger.info("got info: \(scope.currency, privacy: .public)") @@ -124,15 +125,16 @@ fileprivate struct ExchangeRow_Container : View { // let amount = Amount(currency: LONGCURRENCY, cent: 123456) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset, exchangeUpdateStatus: .initial, ageRestrictionOptions: [12,16]) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed, exchangeEntryStatus: .ephemeral, diff --git a/TalerWallet1/Views/Banking/ExchangeSectionView.swift b/TalerWallet1/Views/Banking/ExchangeSectionView.swift index 80a8e9a..09bfa7e 100644 --- a/TalerWallet1/Views/Banking/ExchangeSectionView.swift +++ b/TalerWallet1/Views/Banking/ExchangeSectionView.swift @@ -55,15 +55,16 @@ fileprivate struct ExchangeRow_Container : View { // let amount = Amount(currency: LONGCURRENCY, cent: 123456) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset, exchangeUpdateStatus: .initial, ageRestrictionOptions: [12,16]) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed, exchangeEntryStatus: .ephemeral, diff --git a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift index d9ecd26..d4fa7ec 100644 --- a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift +++ b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift @@ -73,8 +73,9 @@ struct ManualWithdrawDone_Container : View { @State private var amountToTransfer = Amount(currency: LONGCURRENCY, cent: 510) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset, |