commit 9dd6a9c4be80bd02c0389bcf7300dd97cd95ea7c
parent 023945226d6f447c6de8fd611afeed940f5c9a02
Author: Marc Stibane <marc@taler.net>
Date: Fri, 18 Oct 2024 17:02:49 +0200
cleanup
Diffstat:
2 files changed, 16 insertions(+), 43 deletions(-)
diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift
@@ -14,10 +14,6 @@ struct ExchangeRowView: View {
let stack: CallStack
@Binding var currencyInfo: CurrencyInfo
let exchange: Exchange
-// @Binding var depositIBAN: String
-// @Binding var accountHolder: String
- let amountAvailable: Amount?
- let currency: String // this is the currency to be used
@Binding var amountToTransfer: Amount // does still have the wrong currency
@Environment(\.sizeCategory) var sizeCategory
@@ -53,23 +49,6 @@ struct ExchangeRowView: View {
}
.listRowSeparator(.hidden)
-// DepositWithdrawV(stack: stack.push(),
-// currencyInfo: $currencyInfo,
-// scopeInfo: exchange.scopeInfo,
-// amountAvailable: amountAvailable,
-// amountToTransfer: $amountToTransfer)
- }
- .task {
- if controller.info(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)
- if let info = try? await model.getCurrencyInfoM(scope: scopeInfo, delay: delay) {
-// logger.info("got info: \(scope.currency, privacy: .public)")
- await controller.setInfo(info)
- }
- }
}
}
}
@@ -105,8 +84,6 @@ fileprivate struct ExchangeRow_Previews: PreviewProvider {
ExchangeRowView(stack: CallStack("Preview"),
currencyInfo: $currencyInfoL,
exchange: exchange1,
- amountAvailable: Amount(currency: LONGCURRENCY, cent: 5000), // 50,00
- currency: LONGCURRENCY,
// depositIBAN: $depositIBAN,
// accountHolder: $accountHolder,
amountToTransfer: $amountToPreview)
diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift
@@ -32,22 +32,22 @@ struct ExchangeSectionView: View {
@State private var showAlert: Bool = false
@State private var purge: Bool = false
- func amountAvailable(_ exchange: Exchange?, currency: String?) -> Amount? {
- if let exchange {
- for balance in balances {
- if let baseUrl = balance.scopeInfo.url {
- if baseUrl == exchange.exchangeBaseUrl {
- return balance.available
- }
- } else if let currency {
- if currency == balance.scopeInfo.currency {
- return balance.available
- }
- }
- }
- }
- return nil
- }
+// func amountAvailable(_ exchange: Exchange?, currency: String?) -> Amount? {
+// if let exchange {
+// for balance in balances {
+// if let baseUrl = balance.scopeInfo.url {
+// if baseUrl == exchange.exchangeBaseUrl {
+// return balance.available
+// }
+// } else if let currency {
+// if currency == balance.scopeInfo.currency {
+// return balance.available
+// }
+// }
+// }
+// }
+// return nil
+// }
private func deleteExchange() {
disabled = true // don't try this more than once
@@ -81,10 +81,6 @@ struct ExchangeSectionView: View {
ExchangeRowView(stack: stack.push(),
currencyInfo: $currencyInfo,
exchange: exchange,
- amountAvailable: amountAvailable(exchange, currency: currency),
-// depositIBAN: $depositIBAN,
-// accountHolder: $accountHolder,
- currency: currencyName, // TODO: (balance.available) amount.isZero to disable Deposit-button
amountToTransfer: $amountToTransfer) // does still have the wrong currency
.listRowSeparator(.hidden)
// }