gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] branch master updated (989c5ea -> a123c3a)


From: gnunet
Subject: [taler-taler-ios] branch master updated (989c5ea -> a123c3a)
Date: Thu, 07 Dec 2023 00:44:17 +0100

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

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

    from 989c5ea  Debugging
     new e5f3da1  colorSchemeContrast
     new d187278  bank shortcuts
     new c4533fd  Minimalistic
     new e306950  getExchangeByUrl
     new b38c0d5  tosAccepted -> tosStatus
     new 835e740  cleanup
     new e8c47ad  UI
     new a123c3a  Bump version to 0.9.3 (31)

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 TalerWallet.xcodeproj/project.pbxproj              |   4 +-
 TalerWallet1/Model/Model+Exchange.swift            |  28 +++-
 TalerWallet1/Model/Model+P2P.swift                 |   2 +
 TalerWallet1/Model/Model+Withdraw.swift            |  14 +-
 TalerWallet1/Views/Balances/BalanceRowView.swift   |   1 -
 TalerWallet1/Views/Exchange/ExchangeRowView.swift  |   3 +-
 TalerWallet1/Views/Exchange/ManualWithdraw.swift   | 178 ++++++++++-----------
 TalerWallet1/Views/HelperViews/BarGraph.swift      |   4 +-
 TalerWallet1/Views/HelperViews/ToSButtonView.swift |   7 +-
 TalerWallet1/Views/Peer2peer/RequestPayment.swift  |   2 +-
 TalerWallet1/Views/Peer2peer/SendAmount.swift      |   2 +-
 TalerWallet1/Views/Settings/SettingsView.swift     |  12 +-
 .../Sheets/P2P_Sheets/P2pReceiveURIView.swift      |  12 +-
 .../WithdrawBankIntegrated/WithdrawURIView.swift   |  33 ++--
 .../Views/Transactions/ManualDetailsV.swift        |  20 +--
 .../Views/Transactions/TransactionDetailView.swift |  14 +-
 TestFlight/WhatToTest.en-US.txt                    |   9 +-
 17 files changed, 184 insertions(+), 161 deletions(-)

diff --git a/TalerWallet.xcodeproj/project.pbxproj 
b/TalerWallet.xcodeproj/project.pbxproj
index 2b59bc8..058b9b6 100644
--- a/TalerWallet.xcodeproj/project.pbxproj
+++ b/TalerWallet.xcodeproj/project.pbxproj
@@ -1484,7 +1484,7 @@
                                CODE_SIGN_ENTITLEMENTS = 
"$(TARGET_NAME).entitlements";
                                CODE_SIGN_IDENTITY = "Apple Development";
                                CODE_SIGN_STYLE = Automatic;
-                               CURRENT_PROJECT_VERSION = 30;
+                               CURRENT_PROJECT_VERSION = 31;
                                DEVELOPMENT_TEAM = GUDDQ9428Y;
                                ENABLE_PREVIEWS = YES;
                                GENERATE_INFOPLIST_FILE = YES;
@@ -1526,7 +1526,7 @@
                                CODE_SIGN_ENTITLEMENTS = 
"$(TARGET_NAME).entitlements";
                                CODE_SIGN_IDENTITY = "Apple Development";
                                CODE_SIGN_STYLE = Automatic;
-                               CURRENT_PROJECT_VERSION = 30;
+                               CURRENT_PROJECT_VERSION = 31;
                                DEVELOPMENT_TEAM = GUDDQ9428Y;
                                ENABLE_PREVIEWS = YES;
                                GENERATE_INFOPLIST_FILE = YES;
diff --git a/TalerWallet1/Model/Model+Exchange.swift 
b/TalerWallet1/Model/Model+Exchange.swift
index 46aeb6c..4764116 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -93,6 +93,19 @@ fileprivate struct ListExchanges: 
WalletBackendFormattedRequest {
     }
 }
 
+/// A request to get info for one exchange.
+fileprivate struct GetExchangeByUrl: WalletBackendFormattedRequest {
+    typealias Response = Exchange
+    func operation() -> String { "getExchangeEntryByUrl" }
+    func args() -> Args { Args(exchangeBaseUrl: exchangeBaseUrl) }
+
+    var exchangeBaseUrl: String
+
+    struct Args: Encodable {
+        var exchangeBaseUrl: String
+    }
+}
+
 /// A request to update a single exchange.
 fileprivate struct UpdateExchange: WalletBackendFormattedRequest {
     struct Response: Decodable {}   // no result - getting no error back means 
success
@@ -157,9 +170,22 @@ extension WalletModel {
         }
     }
 
+    /// add a new exchange with URL to the wallet's list of known exchanges
+    func getExchangeByUrl(url: String)
+      async -> Exchange? {
+        do {
+            let request = GetExchangeByUrl(exchangeBaseUrl: url)
+            logger.info("query for exchange: \(url, privacy: .public)")
+            let response = try await sendRequest(request)
+            return response
+        } catch {
+            return nil
+        }
+    }
+
     /// add a new exchange with URL to the wallet's list of known exchanges
     func addExchange(url: String)
-      async throws  {
+    async throws {
         let request = AddExchange(exchangeBaseUrl: url)
         logger.info("adding exchange: \(url, privacy: .public)")
         _ = try await sendRequest(request)
diff --git a/TalerWallet1/Model/Model+P2P.swift 
b/TalerWallet1/Model/Model+P2P.swift
index 8a0d003..bff8aeb 100644
--- a/TalerWallet1/Model/Model+P2P.swift
+++ b/TalerWallet1/Model/Model+P2P.swift
@@ -165,6 +165,8 @@ struct PreparePeerPushCreditResponse: Codable {
     let contractTerms: PeerContractTerms
     let amountRaw: Amount
     let amountEffective: Amount
+    let exchangeBaseUrl: String
+//    let peerPushCreditId: String
     // the dialog transaction is already created in the local DB - must either 
accept or delete
     let transactionId: String
 }
diff --git a/TalerWallet1/Model/Model+Withdraw.swift 
b/TalerWallet1/Model/Model+Withdraw.swift
index 8563df4..52f8355 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -18,8 +18,10 @@ struct AccountRestriction: Decodable {
     var human_hint_i18n: String?
 }
 struct WithdrawalExchangeAccountDetails: Decodable {
+    var bankName: String?
     var paytoUri: String
     var transferAmount: Amount
+    var currencySpecification: CurrencySpecification?
     var creditRestrictions: [AccountRestriction]?
 }
 // MARK: -
@@ -43,7 +45,6 @@ fileprivate struct GetWithdrawalDetailsForURI: 
WalletBackendFormattedRequest {
 // MARK: -
 /// The result from getWithdrawalDetailsForAmount
 struct WithdrawalAmountDetails: Decodable {
-    var tosAccepted: Bool               // Did the user accept the current 
version of the exchange's terms of service?
     var amountRaw: Amount               // Amount that the user will transfer 
to the exchange
     var amountEffective: Amount         // Amount that will be added to the 
user's wallet balance
     var numCoins: Int?                  // Number of coins this 
amountEffective will create
@@ -66,14 +67,9 @@ fileprivate struct GetWithdrawalDetailsForAmount: 
WalletBackendFormattedRequest
 }
 // MARK: -
 enum ExchangeTosStatus: String, Codable {
-    case new = "new"                                                           
 // deprecated
-//    case accepted = "accepted"                                               
   // old == new
-    case changed = "changed"                                                   
 // deprecated
-    case notFound = "not-found"                                                
 // deprecated
-    case unknown = "unknown"                                                   
 // deprecated
-    case pending                                                // new, but 
not yet deployed in demo.taler.net
-    case proposed                                               // new, but 
not yet deployed in demo.taler.net
-    case accepted                                               // new == old
+    case pending
+    case proposed
+    case accepted
 }
 struct ExchangeTermsOfService: Decodable {
     var currentEtag: String
diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift 
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index 37222f0..c851611 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -12,7 +12,6 @@ struct BalanceButton: View {
 
     @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("iconOnly") var iconOnly: Bool = false
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
 
     var body: some View {
         let balanceTitleStr = String(localized: "Balance:", comment: "Main 
view")
diff --git a/TalerWallet1/Views/Exchange/ExchangeRowView.swift 
b/TalerWallet1/Views/Exchange/ExchangeRowView.swift
index 15e9c2a..aa93dff 100644
--- a/TalerWallet1/Views/Exchange/ExchangeRowView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeRowView.swift
@@ -56,8 +56,7 @@ struct ExchangeRowView: View {
         }
         let manualWithdraw = LazyView {
             ManualWithdraw(stack: stack.push(),
-//                           url: nil,
-                        exchange: exchange,
+                 exchangeBaseUrl: baseURL,
                 amountToTransfer: $amountToTransfer)
         }
         let showToS = LazyView {
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index da6e34b..9cf3534 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -10,18 +10,15 @@ import SymLog
 struct ManualWithdraw: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
-
-//    let url: URL?
-//    let exchange: Exchange?
-    let exchange: Exchange
+    let exchangeBaseUrl: String
     @Binding var amountToTransfer: Amount
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
     @AppStorage("iconOnly") var iconOnly: Bool = false
 
-    @State var tosAccepted = false
-    @State var withdrawalAmountDetails: WithdrawalAmountDetails? = nil
+    @State private var withdrawalAmountDetails: WithdrawalAmountDetails? = nil
+    @State private var exchange: Exchange? = nil
 //    @State var ageMenuList: [Int] = []
 //    @State var selectedAge = 0
 
@@ -30,77 +27,84 @@ struct ManualWithdraw: View {
         let _ = Self._printChanges()
         let _ = symLog.vlog()       // just to get the # to compare it with 
.onAppear & onDisappear
 #endif
-        let currency = exchange.scopeInfo?.currency ?? exchange.currency ?? 
String(localized: "Unknown", comment: "unknown currency")
-        let currencyInfo = controller.info(for: currency, 
controller.currencyTicker)
-        let navTitle = String(localized: "NavTitle_Withdraw (currency)", 
defaultValue: "Withdraw \(currency)")
-//        let agePicker = AgePicker(ageMenuList: $ageMenuList, selectedAge: 
$selectedAge)
+      Group {
+        if let exchange {
+            let currency = exchange.scopeInfo?.currency
+                        ?? exchange.currency
+                        ?? String(localized: "Unknown", comment: "unknown 
currency")
+            let currencyInfo = controller.info(for: currency, 
controller.currencyTicker)
+            let navTitle = String(localized: "NavTitle_Withdraw (currency)", 
defaultValue: "Withdraw \(currency)")
+//          let agePicker = AgePicker(ageMenuList: $ageMenuList, selectedAge: 
$selectedAge)
 
-        let someCoins = SomeCoins(details: withdrawalAmountDetails)
-//      let restrictAge: Int? = (selectedAge == 0) ? nil
-//                                                 : selectedAge
+            let someCoins = SomeCoins(details: withdrawalAmountDetails)
+//          let restrictAge: Int? = (selectedAge == 0) ? nil
+//                                                     : selectedAge
 //  let _ = print(selectedAge, restrictAge)
-        let destination = LazyView {
-            ManualWithdrawDone(stack: stack.push(),
-                            exchange: exchange,
-                    amountToTransfer: amountToTransfer)
-//                       restrictAge: restrictAge)
-        }
-        let disabled = amountToTransfer.isZero || someCoins.invalid || 
someCoins.tooMany
-        ScrollView { VStack(alignment: .trailing) {
-            Text("via \(exchange.exchangeBaseUrl.trimURL())")
-                .multilineTextAlignment(.center)
-                .accessibilityFont(.body)
-            CurrencyInputView(amount: $amountToTransfer,
-                           available: nil,
-                               title: iconOnly ? String(localized: "How much:")
-                                               : String(localized: "Amount to 
withdraw:"),
-                      shortcutAction: nil)
-                .padding(.top)
-            QuiteSomeCoins(someCoins: someCoins,
-                       shouldShowFee: true,           // TODO: set to false if 
we never charge withdrawal fees
-                            currency: currency,
-                        currencyInfo: currencyInfo,
-                     amountEffective: withdrawalAmountDetails?.amountEffective)
-//          agePicker
-            if tosAccepted {
-                NavigationLink(destination: destination) {
-                    Text("Confirm Withdrawal")      // VIEW_WITHDRAW_ACCEPT
+            let destination = LazyView {
+                ManualWithdrawDone(stack: stack.push(),
+                                exchange: exchange,
+                        amountToTransfer: amountToTransfer)
+//                           restrictAge: restrictAge)
+            }
+            let disabled = amountToTransfer.isZero || someCoins.invalid || 
someCoins.tooMany
+            ScrollView { VStack(alignment: .trailing) {
+                Text("via \(exchange.exchangeBaseUrl.trimURL())")
+                    .multilineTextAlignment(.center)
+                    .accessibilityFont(.body)
+                CurrencyInputView(amount: $amountToTransfer,
+                               available: nil,
+                                   title: iconOnly ? String(localized: 
"Amount:")
+                                                   : String(localized: "Amount 
to withdraw:"),
+                          shortcutAction: nil)
+                    .padding(.top)
+                QuiteSomeCoins(someCoins: someCoins,
+                           shouldShowFee: true,           // TODO: set to 
false if we never charge withdrawal fees
+                                currency: currency,
+                            currencyInfo: currencyInfo,
+                         amountEffective: 
withdrawalAmountDetails?.amountEffective)
+//              agePicker
+                if exchange.tosStatus == .accepted {
+                    NavigationLink(destination: destination) {
+                        Text("Confirm Withdrawal")      // VIEW_WITHDRAW_ACCEPT
+                    }
+                    .buttonStyle(TalerButtonStyle(type: .prominent))
+                    .disabled(disabled)
+                    .padding(.top)
+                } else {
+                    ToSButtonView(stack: stack.push(),
+                        exchangeBaseUrl: exchange.exchangeBaseUrl,
+                                 viewID: VIEW_WITHDRAW_TOS,         // TODO: 
YIKES might be withdraw-exchange
+                                    p2p: false)
+                    .padding(.top)
                 }
-                .buttonStyle(TalerButtonStyle(type: .prominent))
-                .disabled(disabled)
-                .padding(.top)
-            } else {
-                ToSButtonView(stack: stack.push(),
-                    exchangeBaseUrl: exchange.exchangeBaseUrl,
-                             viewID: VIEW_WITHDRAW_TOS,
-                                p2p: false)
-                .padding(.top)
+            } } // ScrollVStack
+            .frame(maxWidth: .infinity, alignment: .leading)
+            .padding(.horizontal)
+            
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
+            .navigationTitle(navTitle)
+            .onAppear {
+                DebugViewC.shared.setViewID(VIEW_WITHDRAWAL, stack: 
stack.push())
+                symLog.log("❗️ \(navTitle) onAppear")
             }
-        } } // ScrollVStack
-        .frame(maxWidth: .infinity, alignment: .leading)
-        .padding(.horizontal)
-        .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
-        .navigationTitle(navTitle)
-        .onAppear {
-            DebugViewC.shared.setViewID(VIEW_WITHDRAWAL, stack: stack.push())
-            symLog.log("❗️ \(navTitle) onAppear")
-        }
-        .onDisappear {
-            symLog.log("❗️ \(navTitle) onDisappear")
+            .onDisappear {
+                symLog.log("❗️ \(navTitle) onDisappear")
+            }
+        } else {
+            WithdrawProgressView(message: exchangeBaseUrl.trimURL())
+                .navigationTitle("Contacting Exchange")
         }
-        .task(id: amountToTransfer.value) { // re-run this whenever 
amountToTransfer changes
+      } .task(id: amountToTransfer.value) { // re-run this whenever 
amountToTransfer changes
+          symLog.log("getExchangeByUrl(\(exchangeBaseUrl))")
             do {
-                let amount = amountToTransfer.isZero ? Amount(currency: 
currency, cent: 100)
-                                                     : amountToTransfer
-//              if amountToTransfer.isZero {
-//                  tosAccepted = GetTosStatus(exchange.exchangeBaseUrl)
-//              } else {
-                    let details = try await 
model.loadWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl,
-                                                                               
   amount: amount)
-                    tosAccepted = details.tosAccepted
-                    withdrawalAmountDetails = amountToTransfer.isZero ? nil : 
details
-//                  agePicker.setAges(ages: 
withdrawalAmountDetails?.ageRestrictionOptions)
-//              }
+                if let exc = await model.getExchangeByUrl(url: 
exchangeBaseUrl) {
+                    exchange = exc
+                    if !amountToTransfer.isZero {
+                        let details = try await 
model.loadWithdrawalDetailsForAmountM(exchangeBaseUrl,
+                                                                               
       amount: amountToTransfer)
+                        withdrawalAmountDetails = details
+//                    agePicker.setAges(ages: 
withdrawalAmountDetails?.ageRestrictionOptions)
+                    }
+                }
             } catch {    // TODO: error
                 symLog.log(error.localizedDescription)
                 withdrawalAmountDetails = nil
@@ -111,33 +115,15 @@ struct ManualWithdraw: View {
 // MARK: -
 #if DEBUG
 struct ManualWithdraw_Previews: PreviewProvider {
-  struct StateContainer : View {
-    @State private var amountToTransfer = Amount(currency: LONGCURRENCY, cent: 
510)
+    struct StateContainer : View {
+        @State private var amountToTransfer = Amount(currency: LONGCURRENCY, 
cent: 510)
 
-      var body: some View {
-        let scopeInfo = ScopeInfo(type: ScopeInfo.ScopeInfoType.exchange, url: 
DEMOEXCHANGE, currency: LONGCURRENCY)
-        let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE,
-                                       currency: LONGCURRENCY,
-                                      paytoUris: [],
-                                      tosStatus: .pending,
-                            exchangeEntryStatus: .preset,
-                           exchangeUpdateStatus: .initial,
-                          ageRestrictionOptions: [])
-        let details = WithdrawalAmountDetails(tosAccepted: false,
-                                                amountRaw: Amount(currency: 
LONGCURRENCY, cent: 510),
-                                          amountEffective: Amount(currency: 
LONGCURRENCY, cent: 500),
-                                                 numCoins: 6,
-//                                              paytoUris: [],
-                                   withdrawalAccountsList: [],
-                                    ageRestrictionOptions: [],
-                                                scopeInfo: scopeInfo)
-        ManualWithdraw(stack: CallStack("Preview"),
-//                         url: nil,
-                    exchange: exchange,
-            amountToTransfer: $amountToTransfer,
-     withdrawalAmountDetails: details)
+        var body: some View {
+            ManualWithdraw(stack: CallStack("Preview"),
+                 exchangeBaseUrl: DEMOEXCHANGE,
+                amountToTransfer: $amountToTransfer)
+        }
     }
-  }
 
     static var previews: some View {
         StateContainer()
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift 
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index 673f6ad..92c6e69 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -13,7 +13,7 @@ struct BarGraphHeader: View {
     let currency: String
 
     @EnvironmentObject private var model: WalletModel
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
 
     @State private var completedTransactions: [Transaction] = []
 
@@ -21,7 +21,7 @@ struct BarGraphHeader: View {
         HStack (alignment: .center, spacing: 10) {
             Text(currency)
                 .accessibilityFont(.title2)
-//                .foregroundColor(moreContrast ? .primary : .secondary)
+//                .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
             BarGraph(transactions: $completedTransactions,
                      maxBars: MAXBARS, barHeight: 10)       // TODO: barHeight 
relative to fontSize
         }
diff --git a/TalerWallet1/Views/HelperViews/ToSButtonView.swift 
b/TalerWallet1/Views/HelperViews/ToSButtonView.swift
index 45a2a91..87ce635 100644
--- a/TalerWallet1/Views/HelperViews/ToSButtonView.swift
+++ b/TalerWallet1/Views/HelperViews/ToSButtonView.swift
@@ -14,9 +14,12 @@ struct ToSButtonView: View {
     let viewID: Int         // either VIEW_WITHDRAW_TOS or SHEET_WITHDRAW_TOS
     let p2p: Bool
 
+    @AppStorage("iconOnly") var iconOnly: Bool = false
+
     var body: some View {
-        let hint = p2p ? String(localized: "You must accept the Exchange's 
Terms of Service first before you can receive electronic cash in your wallet.", 
comment: "P2P Receive")
-                       : String(localized: "You must accept the Exchange's 
Terms of Service first before you can use it to withdraw electronic cash to 
your wallet.")
+        let hint = iconOnly ? String(localized: "You must accept the 
Exchange's Terms of Service first.")
+                      : p2p ? String(localized: "You must accept the 
Exchange's Terms of Service first before you can receive electronic cash in 
your wallet.", comment: "P2P Receive")
+                            : String(localized: "You must accept the 
Exchange's Terms of Service first before you can use it to withdraw electronic 
cash to your wallet.")
         Text(hint)
             .accessibilityFont(.body)
             .multilineTextAlignment(.leading)
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift 
b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
index 45c0441..f30bb0f 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
+++ b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -63,7 +63,7 @@ struct RequestPayment: View {
         ScrollView { VStack(alignment: .trailing) {
             CurrencyInputView(amount: $amountToTransfer,
                            available: nil,
-                               title: iconOnly ? String(localized: "How much:")
+                               title: iconOnly ? String(localized: "Amount:")
                                                : String(localized: "Amount to 
request:"),
                       shortcutAction: shortcutAction)
                 .padding(.top)
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index d66f41c..d74d264 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -87,7 +87,7 @@ struct SendAmount: View {
                 .padding(.bottom, 2)
             CurrencyInputView(amount: $amountToTransfer,
                            available: amountAvailable,
-                               title: iconOnly ? String(localized: "How much:")
+                               title: iconOnly ? String(localized: "Amount:")
                                                : String(localized: "Amount to 
send:"),
                       shortcutAction: shortcutAction)
             Text(insufficient ? insufficientLabel
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index 5451179..a81a9ab 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -22,12 +22,12 @@ struct SettingsView: View {
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+//    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
 #if DEBUG
     @AppStorage("developerMode") var developerMode: Bool = true
 #else
     @AppStorage("developerMode") var developerMode: Bool = false
 #endif
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
     @AppStorage("useHaptics") var useHaptics: Bool = true
     @AppStorage("playSounds") var playSounds: Int = 1
     @AppStorage("talerFont") var talerFont: Int = 0
@@ -100,10 +100,14 @@ struct SettingsView: View {
                           description: hideDescriptions ? nil : 
String(localized: "More info about this app...")) {}
                 }
 #if DEBUG
-                Text("https://bank.taler.grothoff.org/";)
+                Group {
+                    Text("https://bank.taler.grothoff.org/";)
+                    Text("https://bank.taler.fdold.eu/";)
+                    Text("https://bank.head.taler.net/";)
+                    Text("https://bank.test.taler.net/";)
+                    Text("https://bank.demo.taler.net/";)
+                }
 #endif
-//                SettingsToggle(name: String(localized: "More Contrast"), 
value: $moreContrast, id1: "contrast",
-//                               description: hideDescriptions ? nil : 
String(localized: "If you don't like grey"))
                 if controller.hapticCapability.supportsHaptics {
                     SettingsToggle(name: String(localized: "Haptics"), value: 
$useHaptics, id1: "haptics",
                             description: hideDescriptions ? nil : 
String(localized: "Vibration Feedback"))
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index 4a39eca..05da8fb 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -19,7 +19,8 @@ struct P2pReceiveURIView: View {
     @EnvironmentObject private var model: WalletModel
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
-    @State private var peerPushCreditResponse: PreparePeerPushCreditResponse?
+    @State private var peerPushCreditResponse: PreparePeerPushCreditResponse? 
= nil
+    @State private var exchange: Exchange? = nil
 
     var body: some View {
         let badURL = "Error in URL: \(url)"
@@ -41,7 +42,7 @@ struct P2pReceiveURIView: View {
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
-                let tosAccepted = true  // TODO: 
https://bugs.gnunet.org/view.php?id=7869
+                let tosAccepted = exchange?.tosStatus == .accepted
                 if tosAccepted {
                     NavigationLink(destination: LazyView {
                         P2pAcceptDone(stack: stack.push(),
@@ -54,7 +55,7 @@ struct P2pReceiveURIView: View {
                     .padding(.horizontal)
                 } else {
                     ToSButtonView(stack: stack.push(),
-                        exchangeBaseUrl: nil,
+                        exchangeBaseUrl: 
peerPushCreditResponse.exchangeBaseUrl,
                                  viewID: SHEET_RCV_P2P_TOS,
                                     p2p: true)
                 }
@@ -71,8 +72,9 @@ struct P2pReceiveURIView: View {
         .task {
             do { // TODO: cancelled
                 symLog.log(".task")
-                let ppCreditResponse = try await 
model.preparePeerPushCreditM(url.absoluteString)
-                peerPushCreditResponse = ppCreditResponse
+                let ppResponse = try await 
model.preparePeerPushCreditM(url.absoluteString)
+                exchange = await model.getExchangeByUrl(url: 
ppResponse.exchangeBaseUrl)
+                peerPushCreditResponse = ppResponse
             } catch {    // TODO: error
                 symLog.log(error.localizedDescription)
                 peerPushCreditResponse = nil
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
index 56773b4..9ae8592 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -21,14 +21,13 @@ struct WithdrawURIView: View {
     @EnvironmentObject private var model: WalletModel
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
-    // the exchange used for this withdrawal.
-    @State private var exchangeBaseUrl: String? = nil
-    @State private var withdrawalAmountDetails: WithdrawalAmountDetails?
+    @State private var withdrawalAmountDetails: WithdrawalAmountDetails? = nil
+    @State private var exchange: Exchange? = nil
 
     var body: some View {
         let badURL = "Error in URL: \(url)"
         VStack {
-            if let withdrawalAmountDetails, let exchangeBaseUrl {
+            if let withdrawalAmountDetails, let exchange {
                 List {
                     let raw = withdrawalAmountDetails.amountRaw
                     let effective = withdrawalAmountDetails.amountEffective
@@ -45,7 +44,7 @@ struct WithdrawURIView: View {
                               bottomAbbrev: String(localized: "Effective:"),
                               bottomAmount: effective,
                                      large: false, pending: false, incoming: 
true,
-                                   baseURL: exchangeBaseUrl)
+                                   baseURL: exchange.exchangeBaseUrl)
                     let someCoins = SomeCoins(details: withdrawalAmountDetails)
                     QuiteSomeCoins(someCoins: someCoins,
                                shouldShowFee: true,       // TODO: set to 
false if we never charge withdrawal fees
@@ -55,11 +54,10 @@ struct WithdrawURIView: View {
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
-                let tosAccepted = withdrawalAmountDetails.tosAccepted
-                if tosAccepted {
+                if exchange.tosStatus == .accepted {
                     NavigationLink(destination: LazyView {
                         WithdrawAcceptDone(stack: stack.push(),
-                                 exchangeBaseUrl: exchangeBaseUrl,
+                                 exchangeBaseUrl: exchange.exchangeBaseUrl,
                                              url: url)
                     }) {
                         Text("Confirm Withdrawal")      // 
SHEET_WITHDRAW_ACCEPT
@@ -68,12 +66,12 @@ struct WithdrawURIView: View {
                     .padding(.horizontal)
                 } else {
                     ToSButtonView(stack: stack.push(),
-                        exchangeBaseUrl: exchangeBaseUrl,
+                        exchangeBaseUrl: exchange.exchangeBaseUrl,
                                  viewID: SHEET_WITHDRAW_TOS,
                                     p2p: false)
                 }
             } else {
-                // Yikes no details or no baseURL
+                // Yikes no details or no exchange
                 WithdrawProgressView(message: url.host ?? badURL)
                     .navigationTitle("Contacting Exchange")
             }
@@ -86,15 +84,16 @@ struct WithdrawURIView: View {
             do { // TODO: cancelled
                 symLog.log(".task")
                 let withdrawUriInfo = try await 
model.loadWithdrawalDetailsForUriM(url.absoluteString)
-                exchangeBaseUrl = withdrawUriInfo.defaultExchangeBaseUrl ??
-                                  
withdrawUriInfo.possibleExchanges.first?.exchangeBaseUrl
-                if let exchangeBaseUrl {
-                    let amount = withdrawUriInfo.amount
-                    let details = try await 
model.loadWithdrawalDetailsForAmountM(exchangeBaseUrl, amount: amount)
+                let amount = withdrawUriInfo.amount
+                let baseUrl = withdrawUriInfo.defaultExchangeBaseUrl
+                           ?? 
withdrawUriInfo.possibleExchanges.first?.exchangeBaseUrl
+                if let baseUrl, let exc = await model.getExchangeByUrl(url: 
baseUrl) {
+                    exchange = exc
+                    let details = try await 
model.loadWithdrawalDetailsForAmountM(baseUrl, amount: amount)
                     withdrawalAmountDetails = details
-//                  agePicker.setAges(ages: details?.ageRestrictionOptions)
+//                    agePicker.setAges(ages: details?.ageRestrictionOptions)
                 } else {    // TODO: error
-                    symLog.log("no exchangeBaseUrl")
+                    symLog.log("no exchangeBaseUrl or no exchange")
                     withdrawalAmountDetails = nil
                 }
             } catch {    // TODO: error
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift 
b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
index e4400b9..42f827f 100644
--- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
+++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -20,8 +20,8 @@ struct ManualDetailsV: View {
             Group {
                 Text(iconOnly ? "Transfer \(amountStr) to the Exchange."
                               : "You need to transfer \(amountStr) from your 
regular bank account to the Exchange.")
-                Text(iconOnly ? "Step 1: Copy+Paste this subject:"
-                              : "Step 1: Copy this code and paste it into the 
subject/purpose field in your banking app or bank website:")
+                Text(iconOnly ? "**Step 1:** Copy+Paste this subject:"
+                              : "**Step 1:** Copy this code and paste it into 
the subject/purpose field in your banking app or bank website:")
                         .multilineTextAlignment(.leading)
                         .listRowSeparator(.hidden)
                 if !iconOnly {
@@ -40,9 +40,10 @@ struct ManualDetailsV: View {
                         .disabled(false)
                 }   .padding(.leading)
                     .listRowSeparator(.hidden)
-                Text(iconOnly ? "Step 2: Copy+Paste this IBAN:"
-                              : "Step 2: If you don't already have it in your 
banking favourites list, then copy and paste this IBAN into the receiver IBAN 
field in your banking app or website:")
+                Text(iconOnly ? "**Step 2:** Copy+Paste this IBAN:"
+                              : "**Step 2:** If you don't already have it in 
your banking favourites list, then copy and paste this IBAN into the receiver 
IBAN field in your banking app or website (and save it as favourite for the 
next time):")
                     .multilineTextAlignment(.leading)
+                    .padding(.top)
                     .listRowSeparator(.hidden)
                 HStack {
                     Text(iban)
@@ -55,14 +56,15 @@ struct ManualDetailsV: View {
                 }   .padding(.leading)
                     .padding(.top, -8)
                     .listRowSeparator(.hidden)
-                Text(iconOnly ? "Step 3: Transfer \(amountStr)."
-                              : "Step 3: Finish the wire transfer of 
\(amountStr) in your banking app or website, then this withdrawal will proceed 
automatically.")
+                Text(iconOnly ? "**Step 3:** Transfer \(amountStr)."
+                              : "**Step 3:** Finish the wire transfer of 
\(amountStr) in your banking app or website, then this withdrawal will proceed 
automatically.")
                     .multilineTextAlignment(.leading)
+                    .padding(.top)
                     .listRowSeparator(.visible)
-                Text(iconOnly ? "Or use this PayTo-Link:"
-                              : "Alternative: If your bank already supports 
PayTo, you can use this PayTo-Link instead:")
+                Text(iconOnly ? "**Alternative:** Use this PayTo-Link:"
+                              : "**Alternative:** If your bank already 
supports PayTo, you can use this PayTo-Link instead:")
                     .multilineTextAlignment(.leading)
-                    .padding(.top, 2)
+                    .padding(.top)
                     .listRowSeparator(.hidden)
                 HStack {
                     Text(verbatim: "|")       // only reason for this 
leading-aligned text is to get a nice full length listRowSeparator
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index 666c4e1..4e68137 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -36,7 +36,6 @@ struct TransactionDetailView: View {
 
     @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
 #if DEBUG
     @AppStorage("developerMode") var developerMode: Bool = true
 #else
@@ -110,7 +109,7 @@ struct TransactionDetailView: View {
         let (dateString, date) = TalerDater.dateString(from: common.timestamp)
         let accessibilityDate = accessibilityDate(date) ?? dateString
         let navTitle2 = transaction.localizedType
-        Group {
+        VStack {
             List {
                 if developerMode {
                     if transaction.isSuspendable { if let suspendAction {
@@ -149,15 +148,14 @@ struct TransactionDetailView: View {
                     TransactionButton(transactionId: common.transactionId,
                                       command: .delete, action: deleteAction)
                 } } // Delete button
-            }.id(viewId)    // change viewId to enforce a draw update
-            .listStyle(myListStyle.style).anyView
-            .safeAreaInset(edge: .bottom) {
                 if let doneAction {
                     Button(transaction.shouldConfirm ? "Confirm later" : 
"Done", action: doneAction)
                         .buttonStyle(TalerButtonStyle(type: 
transaction.shouldConfirm ? .bordered : .prominent))
-                        .padding(.horizontal)
-                }
-            }
+                } // Done button
+            }.id(viewId)    // change viewId to enforce a draw update
+            .listStyle(myListStyle.style).anyView
+//            .safeAreaInset(edge: .bottom) {
+//            }
         } // Group
         .onNotification(.TransactionExpired) { notification in
             // TODO: Alert user that this tx just expired
diff --git a/TestFlight/WhatToTest.en-US.txt b/TestFlight/WhatToTest.en-US.txt
index 452b0d7..82745ef 100644
--- a/TestFlight/WhatToTest.en-US.txt
+++ b/TestFlight/WhatToTest.en-US.txt
@@ -1,7 +1,14 @@
 
+Version 0.9.3 (31)
+
+• New feature: Shortcuts in P2P directly advance to subject
+• New feature: ToS in P2P receive
+
+- improved withdrawal UI
+
+
 Version 0.9.3 (30)
 
-• New feature: 
 - Bugfix: Manual withdrawal works again (was broken in 29)
 - Bugfix: Currency input with zero fractional digits (test.taler.net)
 

-- 
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]