taler-ios

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

commit fa8d6071fee05b2541bb75405ac86090046ee100
parent 65ed8ed5e37bc76a705037e404e77c12804887f4
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 18 Jul 2024 14:39:24 +0200

no message

Diffstat:
MTalerWallet1/Views/Sheets/Payment/PayTemplateV.swift | 20+++++++++++++++++---
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift | 2++
2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift @@ -39,7 +39,7 @@ struct PayTemplateV: View { @State private var summaryIsEditable = false @State private var summary: String = EMPTYSTRING // templateParam -// @State private var feeAmount: Amount? = nil + @State private var feeAmount: Amount? = nil // @State private var feeStr: String = EMPTYSTRING private func shortcutAction(_ shortcut: Amount) { @@ -65,6 +65,19 @@ struct PayTemplateV: View { } } + private func computeFeePayTemplate(_ amount: Amount) async -> ComputeFeeResult? { +// if let result = await preparePayForTemplate(model: model, +// url: url, +// amount: amountToTransfer, +// summary: summaryIsEditable ? summary ?? " " +// : nil, +// announce: announce) +// { +// preparePayResult = result.ppCheck +// } + return nil + } + var body: some View { if let templateContract { // preparePayResult // let effective = preparePayResult.amountEffective @@ -127,9 +140,10 @@ struct PayTemplateV: View { summaryIsEditable: summaryIsEditable, summary: $summary, // insufficient: $insufficient, -// feeAmount: $feeAmount, + feeAmount: $feeAmount, shortcutAction: shortcutAction, - buttonAction: buttonAction1) + buttonAction: buttonAction1, + computeFee: computeFeePayTemplate) ScrollView { if summaryIsEditable { // after amount input, amountInput diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -41,6 +41,8 @@ struct WithdrawURIView: View { @State private var possibleExchanges: [Exchange] = [] @State private var defaultExchangeBaseUrl: String? // if nil then use possibleExchanges + @State private var feeAmount: Amount? = nil + func loadExchange(_ baseUrl: String) async { // TODO: throws? if let someExchange = try? await model.getExchangeByUrl(url: baseUrl) { exchange = someExchange