summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Stibane <marc@taler.net>2023-12-05 16:17:55 +0100
committerMarc Stibane <marc@taler.net>2023-12-05 16:20:23 +0100
commitfa2041e1ba656f66077acaedb52d4234c4fc40f4 (patch)
tree2059ff12fa43f421218efae7acea3babaf45efee
parentdee64048bad4587285973f1cda53fef268664a97 (diff)
downloadtaler-ios-fa2041e1ba656f66077acaedb52d4234c4fc40f4.tar.gz
taler-ios-fa2041e1ba656f66077acaedb52d4234c4fc40f4.tar.bz2
taler-ios-fa2041e1ba656f66077acaedb52d4234c4fc40f4.zip
cleanup
-rw-r--r--TalerWallet1/Views/Balances/BalancesListView.swift2
-rw-r--r--TalerWallet1/Views/Exchange/ExchangeRowView.swift4
-rw-r--r--TalerWallet1/Views/Peer2peer/P2PReadyV.swift2
-rw-r--r--TalerWallet1/Views/Peer2peer/SendAmount.swift11
4 files changed, 9 insertions, 10 deletions
diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift
index f7ee719..b425948 100644
--- a/TalerWallet1/Views/Balances/BalancesListView.swift
+++ b/TalerWallet1/Views/Balances/BalancesListView.swift
@@ -22,7 +22,7 @@ struct BalancesListView: View {
@EnvironmentObject private var model: WalletModel
@State private var lastReloadedBalances = 0
- @State private var amountToTransfer = Amount.zero(currency: "") // Update currency when used
+ @State private var amountToTransfer = Amount.zero(currency: EMPTYSTRING) // Update currency when used
@State private var summary: String = ""
@State private var showQRScanner: Bool = false
@State private var showCameraAlert: Bool = false
diff --git a/TalerWallet1/Views/Exchange/ExchangeRowView.swift b/TalerWallet1/Views/Exchange/ExchangeRowView.swift
index 9c6cdaf..a385067 100644
--- a/TalerWallet1/Views/Exchange/ExchangeRowView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeRowView.swift
@@ -78,9 +78,9 @@ struct ExchangeRowView: View {
Text(baseURL.trimURL())
.accessibilityFont(.headline)
NavigationLink(destination: deposit, tag: 1, selection: $buttonSelected)
- { EmptyView() }.frame(width: 0).opacity(0)
+ { EmptyView() }.frame(width: 0).opacity(0)
NavigationLink(destination: manualWithdraw, tag: 2, selection: $buttonSelected)
- { EmptyView() }.frame(width: 0).opacity(0)
+ { EmptyView() }.frame(width: 0).opacity(0)
}.listRowSeparator(.hidden)
NavigationLink(destination: showToS) {
Text("Terms of Service") // VIEW_WITHDRAW_TOS
diff --git a/TalerWallet1/Views/Peer2peer/P2PReadyV.swift b/TalerWallet1/Views/Peer2peer/P2PReadyV.swift
index 80ac75d..a446ae3 100644
--- a/TalerWallet1/Views/Peer2peer/P2PReadyV.swift
+++ b/TalerWallet1/Views/Peer2peer/P2PReadyV.swift
@@ -62,7 +62,7 @@ struct P2PReadyV: View {
.onDisappear {
// print("❗️ P2PReadyV onDisappear")
}
- .task {
+ .task(id: amountToTransfer.value) {
symLog.log(".task")
do {
guard transactionStarted == false else {
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index cf4821f..99de703 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -20,8 +20,8 @@ struct SendAmount: View {
@AppStorage("iconOnly") var iconOnly: Bool = false
@State var peerPushCheck: CheckPeerPushDebitResponse? = nil
- @State private var expireDays: UInt = SEVENDAYS
- @State private var insufficient: Bool = false
+ @State private var expireDays = SEVENDAYS
+ @State private var insufficient = false
@State private var feeStr: String = EMPTYSTRING
private func fee(ppCheck: CheckPeerPushDebitResponse?) -> Amount? {
@@ -56,6 +56,7 @@ struct SendAmount: View {
comment: "NavTitle: Send 'amountStr'")
let available = amountAvailable.string(currencyInfo)
+// let _ = print("available: \(available)")
let _ = symLog.log("currency: \(currency), available: \(available)")
let amountVoiceOver = amountToTransfer.string(currencyInfo)
let insufficientLabel = String(localized: "You don't have enough \(currency).")
@@ -63,7 +64,6 @@ struct SendAmount: View {
let disabled = insufficient || amountToTransfer.isZero
ScrollView { VStack(alignment: .trailing) {
-// let _ = print("available: \(available)")
Text("Available:\t\(available)")
.accessibilityFont(.title3)
.padding(.bottom, 2)
@@ -105,7 +105,6 @@ struct SendAmount: View {
.task(id: amountToTransfer.value) {
do {
insufficient = try amountToTransfer > amountAvailable
- print("amountStr: \(amountVoiceOver)")
} catch {
print("Yikes❗️ insufficient failed❗️")
insufficient = true
@@ -136,14 +135,14 @@ struct SendAmount: View {
// MARK: -
#if DEBUG
fileprivate struct Preview_Content: View {
- @State private var amountToTransfer = Amount(currency: TESTCURRENCY, cent: 510)
+ @State private var amountToPreview = Amount(currency: TESTCURRENCY, cent: 510)
@State private var summary: String = ""
var body: some View {
let amount = Amount(currency: TESTCURRENCY, integer: 10, fraction: 0)
SendAmount(stack: CallStack("Preview"),
amountAvailable: amount,
- amountToTransfer: $amountToTransfer,
+ amountToTransfer: $amountToPreview,
summary: $summary)
}
}