commit 18a97cfd1f4922bd34adcb4ea811ae1b93c7f573
parent 25090cfa73f09365706bf6b69a64135b0b799c55
Author: Marc Stibane <marc@taler.net>
Date: Tue, 22 Jul 2025 09:58:08 +0200
tappedVal
Diffstat:
6 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/TalerWallet1/Views/OIM/OIMEditView.swift b/TalerWallet1/Views/OIM/OIMEditView.swift
@@ -99,7 +99,6 @@ struct OIMEditView: View {
OIMlineView(stack: stack.push(),
cash: cash,
amountVal: $amountVal,
- tappedVal: $tappedVal, // <- user tapped a val in the scroller
canEdit: true)
.matchedGeometryEffect(id: "OIMline", in: wrapper.namespace, isSource: true)
.zIndex(1) // make notes fly from topZ
@@ -114,6 +113,20 @@ struct OIMEditView: View {
availRest = Amount(currency: currencyStr, cent: UInt64(availableVal))
// }
}
+ .onChange(of: tappedVal) { newVal in
+ if newVal > 0 {
+// symLog.log(">>tapped \(newVal)")
+ tappedVal = 0
+
+ DispatchQueue.main.async { // next layout cycle
+ withAnimation(.move1) {
+// symLog.log(">>addCash \(newVal)")
+ cash.addCash(value: newVal)
+ amountVal += newVal // update directly
+ }
+ }
+ }
+ }
if !sending { // need space for currency scroller
Spacer()
Spacer()
diff --git a/TalerWallet1/Views/OIM/OIMSubjectView.swift b/TalerWallet1/Views/OIM/OIMSubjectView.swift
@@ -64,7 +64,6 @@ struct OIMSubjectView: View {
@State private var amountVal: UInt64 = 0
@State private var sending = false // user tapped on Send
@State private var appeared = false
- @State private var ignoreTapped: UInt64 = 0
func sendAction() {
withAnimation(.basic1) {
@@ -109,7 +108,6 @@ struct OIMSubjectView: View {
OIMlineView(stack: stack.push(),
cash: cash,
amountVal: $amountVal,
- tappedVal: $ignoreTapped,
canEdit: false)
.scaleEffect(selectedGoal == nil ? 0.6 : 1)
.onTapGesture {
diff --git a/TalerWallet1/Views/OIM/OIMbalances.swift b/TalerWallet1/Views/OIM/OIMbalances.swift
@@ -203,7 +203,6 @@ struct OIMbalances: View {
OIMlineView(stack: stack.push(),
cash: cash,
amountVal: $availableVal,
- tappedVal: $tappedVal,
canEdit: false)
.opacity(isOpen ? 1 : INVISIBLE)
// .scaleEffect(scaleMoney ? 0.6 : 1)
diff --git a/TalerWallet1/Views/OIM/OIMlineView.swift b/TalerWallet1/Views/OIM/OIMlineView.swift
@@ -18,7 +18,7 @@ struct OIMlineView: View {
let stack: CallStack
let cash: OIMcash
@Binding var amountVal: UInt64
- @Binding var tappedVal: UInt64
+// @Binding var tappedVal: UInt64
let canEdit: Bool
@EnvironmentObject private var wrapper: NamespaceWrapper
@@ -55,20 +55,20 @@ struct OIMlineView: View {
.padding(1)
.border(orange)
#endif
- .onChange(of: tappedVal) { newVal in
- if newVal > 0 {
- symLog.log(">>tapped \(newVal)")
- tappedVal = 0
-
- DispatchQueue.main.async { // next layout cycle
- withAnimation(.move1) {
- symLog.log(">>addCash \(newVal)")
- cash.addCash(value: newVal)
- amountVal += newVal // update directly
- }
- }
- }
- }
+// .onChange(of: tappedVal) { newVal in
+// if newVal > 0 {
+// symLog.log(">>tapped \(newVal)")
+// tappedVal = 0
+//
+// DispatchQueue.main.async { // next layout cycle
+// withAnimation(.move1) {
+// symLog.log(">>addCash \(newVal)")
+// cash.addCash(value: newVal)
+// amountVal += newVal // update directly
+// }
+// }
+// }
+// }
}
}
diff --git a/TalerWallet1/Views/OIM/OIMp2pReceiveView.swift b/TalerWallet1/Views/OIM/OIMp2pReceiveView.swift
@@ -22,7 +22,6 @@ struct OIMp2pReceiveView: View {
@State private var amount: Amount?
@State private var amountVal: UInt64 = 0
@State private var appeared = false
- @State private var ignoreTapped: UInt64 = 0
var body: some View {
// let _ = Self._printChanges()
@@ -58,7 +57,6 @@ struct OIMp2pReceiveView: View {
OIMlineView(stack: stack.push(),
cash: cash,
amountVal: $amountVal,
- tappedVal: $ignoreTapped,
canEdit: false)
Spacer()
}
diff --git a/TalerWallet1/Views/OIM/OIMpayView.swift b/TalerWallet1/Views/OIM/OIMpayView.swift
@@ -19,7 +19,6 @@ struct OIMpayView: View {
@StateObject private var cash = OIMcash()
@State private var amountVal: UInt64 = 0
- @State private var tappedVal: UInt64 = 0
var body: some View {
// let _ = Self._printChanges()
@@ -31,7 +30,6 @@ struct OIMpayView: View {
OIMlineView(stack: stack.push(),
cash: cash,
amountVal: $amountVal,
- tappedVal: $tappedVal,
canEdit: true)
.matchedGeometryEffect(id: "OIMline", in: wrapper.namespace, isSource: true)
Spacer()