gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 19/204: cleanup, debug


From: gnunet
Subject: [taler-taler-ios] 19/204: cleanup, debug
Date: Thu, 05 Dec 2024 23:49:47 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit c7e7be7e11dcc98cbcf2995b99182e175f03caf2
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Sep 13 09:39:17 2024 +0200

    cleanup, debug
---
 TalerWallet1/Views/Actions/ActionsSheet.swift      |  9 ++--
 .../Views/Actions/Peer2peer/SendAmount.swift       |  6 +--
 TalerWallet1/Views/Balances/BalancesListView.swift |  2 +-
 .../Views/Balances/BalancesSectionView.swift       | 60 +---------------------
 TalerWallet1/Views/HelperViews/AmountInputV.swift  |  6 +--
 TalerWallet1/Views/HelperViews/SubjectInputV.swift |  2 +-
 .../Views/Transactions/ManualDetailsV.swift        | 10 ++--
 7 files changed, 19 insertions(+), 76 deletions(-)

diff --git a/TalerWallet1/Views/Actions/ActionsSheet.swift 
b/TalerWallet1/Views/Actions/ActionsSheet.swift
index 5f7d3f2..dea2e5f 100644
--- a/TalerWallet1/Views/Actions/ActionsSheet.swift
+++ b/TalerWallet1/Views/Actions/ActionsSheet.swift
@@ -8,6 +8,10 @@
 import SwiftUI
 import taler_swift
 
+/// This view shows the action sheet
+/// optional:   [􀰟Spend KUDOS]
+///    [􁉇Send]  [􁉅Request]
+/// [􁾭Withdraw]  [􁾩Deposit]
 struct ActionsSheet: View {
     let stack: CallStack
     @Binding var balances: [Balance]
@@ -60,17 +64,12 @@ struct ActionsSheet: View {
 
             SendRequestV(stack: stack.push(),
                       balances: $balances,
-//                currencyInfo: $currencyInfo,
-//             amountAvailable: balance.available,
               amountToTransfer: $amountToTransfer,   // does still have the 
wrong currency
                        summary: $summary,
                   cameraAction: cameraAction)
 
             DepositWithdrawV(stack: stack.push(),
                           balances: $balances,
-//                    currencyInfo: $currencyInfo,
-//                       scopeInfo: balance.scopeInfo,
-//                 amountAvailable: balance.available,
                   amountToTransfer: $amountToTransfer)   // does still have 
the wrong currency
             .padding(.bottom, 12)
         }
diff --git a/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
index 4614c30..559d3c5 100644
--- a/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
@@ -14,7 +14,7 @@ struct SendAmount: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
     let balances: [Balance]
-    @Binding var selectedBalance: Balance?
+    @Binding var selectedBalance: Balance?      // selected balance when the 
action button is tapped in Transactions
     @Binding var amountToTransfer: Amount
     @Binding var summary: String
     let scopeInfo: ScopeInfo
@@ -264,7 +264,7 @@ fileprivate struct Preview_Content: View {
     @State private var amountToPreview = Amount(currency: DEMOCURRENCY, cent: 
510)
     @State private var summary: String = ""
     @State private var currencyInfoL: CurrencyInfo = 
CurrencyInfo.zero(DEMOCURRENCY)
-    @State private var selectedBalance: Balance? = nil
+    @State private var noBalance: Balance? = nil
 
     private func checkCameraAvailable() -> Void {
         // Open Camera when QR-Button was tapped
@@ -289,7 +289,7 @@ fileprivate struct Preview_Content: View {
                                   flags: [])
         SendAmount(stack: CallStack("Preview"),
                 balances: [balance],
-         selectedBalance: $selectedBalance,
+         selectedBalance: $noBalance,
         amountToTransfer: $amountToPreview,
                  summary: $summary,
                scopeInfo: currencyInfo.scope,
diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift 
b/TalerWallet1/Views/Balances/BalancesListView.swift
index 53f3083..ae4b55c 100644
--- a/TalerWallet1/Views/Balances/BalancesListView.swift
+++ b/TalerWallet1/Views/Balances/BalancesListView.swift
@@ -51,7 +51,7 @@ struct BalancesListView: View {
         let _ = Self._printChanges()
         let _ = symLog.vlog()       // just to get the # to compare it with 
.onAppear & onDisappear
 #endif
-        Group { // necessary for .backslide transition (bug in SwiftUI)
+        Group {
             let count = balances.count
             if balances.isEmpty {
                 WalletEmptyView(stack: stack.push("isEmpty"))
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index bb38d9a..ad1dd4d 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -12,13 +12,9 @@ import SymLog
 /// This view shows a currency section
 ///     Currency Name
 /// "Balance"                   $balance                    // leads to 
completed Transactions (.done)
-/// [􁉇Send $currency]  [􁉅Request $currency]
 /// optional:   Pending Incoming
 /// optional:   Pending Outgoing
-/// optional:   [􀰟Spend KUDOS]
-/// [􁾭Withdraw $currency]  [􁾩Deposit $currency]
 /// optional?:   Suspended / Aborting / Aborted / Expired
-
 struct BalancesSectionView {
     private let symLog = SymLogV(0)
     let stack: CallStack
@@ -49,7 +45,6 @@ struct BalancesSectionView {
     @State private var currencyInfo = CurrencyInfo.zero(UNKNOWN)
     @State private var currencyName: String = UNKNOWN
     @State private var currencySymbol: String = UNKNOWN
-//    @State private var buttonSelected: Int? = nil
 
     private static func className() -> String {"\(self)"}
 
@@ -127,31 +122,12 @@ extension BalancesSectionView: View {
             BalanceCellV(stack: stack.push("BalanceCell"),
                   currencyInfo: $currencyInfo,
                         amount: balance.available,
-//                        sizeCategory: sizeCategory,
-//                     rowAction: { buttonSelected = 3 },     // trigger 
TransactionList NavigationLink
+//                sizeCategory: sizeCategory,
+//                   rowAction: { buttonSelected = 3 },     // trigger 
TransactionList NavigationLink
                    balanceDest: balanceDest)
 //            .listRowSeparator(.hidden)
 //            .border(.red)
 
-//            SendRequestV(stack: stack.push(),
-//                  currencyInfo: $currencyInfo,
-//               amountAvailable: balance.available,
-//              amountToTransfer: $amountToTransfer,
-//                       summary: $summary,
-//                  cameraAction: cameraAction)
-//            .listRowSeparator(.hidden)
-
-//            BalancesNavigationLinksV(symLog: symLog,
-//                                         stack: stack.push("Section"),
-//                                  currencyInfo: currencyInfo,
-//                                       balance: balance,
-//                              amountToTransfer: $amountToTransfer,      // 
does still have the wrong currency
-//                                       summary: $summary,
-//                         completedTransactions: $completedTransactions,
-//                               reloadAllAction: reloadCompleted,
-//                               reloadOneAction: reloadOneAction,
-//                                  cameraAction: cameraAction)
-
             if pendingTransactions.count > 0 {
                 BalancesPendingRowV(//symLog: symLog,
                                      stack: stack.push(),
@@ -163,38 +139,6 @@ extension BalancesSectionView: View {
                            reloadOneAction: reloadOneAction)
                     .padding(.leading, ICONLEADING)
             }
-//            let showSpendingButton = DEMOCURRENCY == currency && 
!balance.available.isZero
-//            if showSpendingButton {
-//                if !minimalistic && showSpendingHint {
-//                    Text("You can spend these \(currencyName) in the Demo 
shop, or send them to another wallet.")
-//                        .talerFont(.body)
-//                        .multilineTextAlignment(.leading)
-//                        .listRowSeparator(.hidden)
-//                }
-//                let title = String(localized: "LinkTitle_DEMOSHOP", 
defaultValue: "Spend demo money")
-//                let action = {
-//                    showSpendingHint = false
-//                    UIApplication.shared.open(URL(string:DEMOSHOP)!, 
options: [:])
-//                }
-//                Button(action: action) {
-//                    HStack {
-//                        ButtonIconBadge(type: .payment, foreColor: 
.accentColor, done: false)
-//                        Spacer()
-//                        Text(title)
-//                        Spacer()
-//                    }
-//                }
-//                .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
false, aligned: .center))
-//                .accessibilityHint(String(localized: "Will go to the demo 
shop website."))
-//                .listRowSeparator(.hidden)
-//            }
-
-//            DepositWithdrawV(stack: stack.push(),
-//                      currencyInfo: $currencyInfo,
-//                         scopeInfo: balance.scopeInfo,
-//                   amountAvailable: balance.available,
-//                  amountToTransfer: $amountToTransfer)   // does still have 
the wrong currency
-
         } header: {
             BarGraphHeader(stack: stack.push(),
                        scopeInfo: scopeInfo,
diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift 
b/TalerWallet1/Views/HelperViews/AmountInputV.swift
index a5d4724..2a12169 100644
--- a/TalerWallet1/Views/HelperViews/AmountInputV.swift
+++ b/TalerWallet1/Views/HelperViews/AmountInputV.swift
@@ -28,7 +28,7 @@ struct ComputeFeeResult {
                              numCoins: -1)
     }
 }
-
+// MARK: -
 struct AmountInputV: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
@@ -123,11 +123,11 @@ struct AmountInputV: View {
                 if let result: ComputeFeeResult = await 
computeFee(amountToTransfer) {
                     symLog.log("computeFee() finished")
                     feeStr = result.feeStr
-//                    insufficient = result.insufficient
+//                    insufficient = result.insufficient    // TODO: 
insufficient
                     feeAmount = result.feeAmount
                     numCoins = result.numCoins
                 } else {
-                    symLog.log("computeFee() failed")
+                    symLog.log("computeFee() failed ❗️") //  \(error)")
                 }
             }
         }
diff --git a/TalerWallet1/Views/HelperViews/SubjectInputV.swift 
b/TalerWallet1/Views/HelperViews/SubjectInputV.swift
index bf82561..e9e436f 100644
--- a/TalerWallet1/Views/HelperViews/SubjectInputV.swift
+++ b/TalerWallet1/Views/HelperViews/SubjectInputV.swift
@@ -15,7 +15,7 @@ struct SubjectInputV<TargetView: View>: View {
     @Binding var currencyInfo: CurrencyInfo
     // the scanned URL
     let url: URL?
-    let amountAvailable: Amount?                    // TODO: 
GetMaxPeerPushAmount
+    let amountAvailable: Amount?            // TODO: getMaxDepositAmountM, 
getMaxPeerPushDebitAmountM
     @Binding var amountToTransfer: Amount
     let amountLabel: String
     @Binding var summary: String
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift 
b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
index c2fe269..a1ebf5b 100644
--- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
+++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -83,10 +83,10 @@ struct AccountPicker: View {
     let accountDetails: [WithdrawalExchangeAccountDetails]
     let action: (Int) -> Void
 
-    @State private var selectedAccount = 0
+    @State private var selected = 0
 
     var body: some View {
-        Picker(title, selection: $selectedAccount) {
+        Picker(title, selection: $selected) {
             ForEach(0..<accountDetails.count, id: \.self) { index in
                 let detail = accountDetails[index]
                     if let amount = detail.transferAmount {
@@ -105,10 +105,10 @@ struct AccountPicker: View {
         .talerFont(.title3)
         .pickerStyle(.menu)
         .onAppear() {
-            withAnimation { selectedAccount = value }
+            withAnimation { selected = value }
         }
-        .onChange(of: selectedAccount) { selected in
-            action(selected)
+        .onChange(of: selected) { newValue in
+            action(newValue)
         }
     }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]