[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 08/36: Cleanup
From: |
gnunet |
Subject: |
[taler-taler-ios] 08/36: Cleanup |
Date: |
Mon, 13 Nov 2023 21:27:13 +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 d039dbdf59f85baa8dee57c5727fc523391335bc
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Nov 12 10:11:38 2023 +0100
Cleanup
---
TalerWallet1/Controllers/Controller.swift | 3 +-
TalerWallet1/Views/Balances/BalanceRowView.swift | 9 ++-
TalerWallet1/Views/Balances/PendingRowView.swift | 5 +-
TalerWallet1/Views/Exchange/ManualWithdraw.swift | 8 +--
.../Views/HelperViews/CurrencyInputView.swift | 11 ++--
TalerWallet1/Views/Peer2peer/SendPurpose.swift | 2 +-
TalerWallet1/Views/Settings/AboutView.swift | 4 --
TalerWallet1/Views/Settings/SettingsView.swift | 2 -
.../Views/Sheets/Payment/PaymentView.swift | 71 +++++++++++-----------
9 files changed, 51 insertions(+), 64 deletions(-)
diff --git a/TalerWallet1/Controllers/Controller.swift
b/TalerWallet1/Controllers/Controller.swift
index fe55625..891a62a 100644
--- a/TalerWallet1/Controllers/Controller.swift
+++ b/TalerWallet1/Controllers/Controller.swift
@@ -54,6 +54,7 @@ class Controller: ObservableObject {
backendState = .instantiated
currencyInfos = []
}
+// MARK: -
func info(for currency: String) -> CurrencyInfo? {
for currencyInfo in currencyInfos {
@@ -81,7 +82,7 @@ class Controller: ObservableObject {
}
currencyInfos.append(info)
}
-
+// MARK: -
@MainActor
func initWalletCore(_ model: WalletModel, sqlite3: Bool)
async throws {
diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index 1ce34c8..8645194 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -99,7 +99,8 @@ struct BalanceRowView: View {
// MARK: -
#if DEBUG
-struct SomeBalanceRows: View {
+struct BalanceRowView_Previews: PreviewProvider {
+ struct StateContainer: View {
var body: some View {
let testInfo = PreviewCurrencyInfo(TESTCURRENCY, digits: 0)
let demoInfo = PreviewCurrencyInfo(TESTCURRENCY, digits: 2)
@@ -114,13 +115,11 @@ struct SomeBalanceRows: View {
}
BalanceRowView(amount: test, currencyInfo: testInfo, sendAction:
{}, recvAction: {}, rowAction: {})
}
-
}
-}
+ }
-struct BalanceRowView_Previews: PreviewProvider {
static var previews: some View {
- SomeBalanceRows()
+ StateContainer()
// .environment(\.sizeCategory, .extraExtraLarge) Canvas Device
Settings
}
}
diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift
b/TalerWallet1/Views/Balances/PendingRowView.swift
index ec06e05..f36c67a 100644
--- a/TalerWallet1/Views/Balances/PendingRowView.swift
+++ b/TalerWallet1/Views/Balances/PendingRowView.swift
@@ -108,16 +108,13 @@ struct PendingRowView: View {
}
// MARK: -
#if DEBUG
-
func PreviewCurrencyInfo(_ currency: String, digits: Int) -> CurrencyInfo {
let unitName = digits == 0 ? "¥" : "€"
let scope = ScopeInfo(type: .global, currency: currency)
- let specs = CurrencySpecification(name: TESTCURRENCY,
-// decimalSeparator: ".", groupSeparator: "'",
+ let specs = CurrencySpecification(name: currency,
fractionalInputDigits: digits,
fractionalNormalDigits: digits,
fractionalTrailingZeroDigits: digits,
-// isCurrencyNameLeading: true,
altUnitNames: [0 : unitName])
let formatter = CurrencyFormatter.formatter(scope: scope, specs: specs)
return CurrencyInfo(scope: scope, specs: specs, formatter: formatter)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 7fba4e9..eaa44a3 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -96,7 +96,8 @@ struct ManualWithdraw: View {
}
// MARK: -
#if DEBUG
-struct ManualWithdraw_Container : View {
+struct ManualWithdraw_Previews: PreviewProvider {
+ struct StateContainer : View {
@State private var centsToTransfer: UInt64 = 510
@State private var details = WithdrawalAmountDetails(tosAccepted: false,
amountRaw:
Amount(currency: LONGCURRENCY, cent: 510),
@@ -117,11 +118,10 @@ struct ManualWithdraw_Container : View {
centsToTransfer: $centsToTransfer,
withdrawalAmountDetails: details)
}
-}
+ }
-struct ManualWithdraw_Previews: PreviewProvider {
static var previews: some View {
- ManualWithdraw_Container()
+ StateContainer()
}
}
#endif
diff --git a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
index f89a702..156a609 100644
--- a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
+++ b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
@@ -1,10 +1,7 @@
-//
-// CurrencyInputView.swift
-// TalerWalletT
-//
-// Created by Marc Stibane on 2023-06-04.
-// Copyright © 2023 Taler. All rights reserved.
-//
+/*
+ * This file is part of GNU Taler, ©2022-23 Taler Systems S.A.
+ * See LICENSE.md
+ */
import SwiftUI
struct CurrencyInputView: View {
diff --git a/TalerWallet1/Views/Peer2peer/SendPurpose.swift
b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
index 06ba0a4..b1a3dc5 100644
--- a/TalerWallet1/Views/Peer2peer/SendPurpose.swift
+++ b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
@@ -9,7 +9,6 @@ import SymLog
struct SendPurpose: View {
private let symLog = SymLogV(0)
let stack: CallStack
- @FocusState private var isFocused: Bool
let amountAvailable: Amount
let centsToTransfer: UInt64
@@ -26,6 +25,7 @@ struct SendPurpose: View {
// return formatter.string(for: Decimal(centsToTransfer) / mag) ?? ""
return String(centsToTransfer / 100) // TODO: based on currency
}
+ @FocusState private var isFocused: Bool
var body: some View {
let amount = Amount.amountFromCents(amountAvailable.currencyStr,
centsToTransfer)
diff --git a/TalerWallet1/Views/Settings/AboutView.swift
b/TalerWallet1/Views/Settings/AboutView.swift
index 2e460bf..3649414 100644
--- a/TalerWallet1/Views/Settings/AboutView.swift
+++ b/TalerWallet1/Views/Settings/AboutView.swift
@@ -94,11 +94,7 @@ extension Bundle {
#if DEBUG
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
-#if TABBAR // Taler Wallet
AboutView(stack: CallStack("Preview"), navTitle: "About")
-#else // GNU Taler
- SettingsView(stack: CallStack("Preview"), navTitle: "About") { }
-#endif
}
}
#endif
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift
b/TalerWallet1/Views/Settings/SettingsView.swift
index 40abcc2..360abde 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -13,8 +13,6 @@ import SymLog
* Debug log
* View/send internal log
*
- * Reset Wallet (dangerous!)
- * Throws away your money
*/
struct SettingsView: View {
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
index ebb8943..50e9f2b 100644
--- a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
@@ -119,44 +119,43 @@ struct PaymentURIView_Previews: PreviewProvider {
let extra = Extra(articleName: "articleName")
let product = Product(description: "description")
let terms = MerchantContractTerms(hWire: "hWire",
- wireMethod: "wireMethod",
- summary: "summary",
- summaryI18n: nil,
+ wireMethod: "wireMethod",
+ summary: "summary",
+ summaryI18n: nil,
nonce: "nonce",
- amount: Amount(currency:
LONGCURRENCY, cent: 220),
- payDeadline: Timestamp.tomorrow(),
- maxFee: Amount(currency:
LONGCURRENCY, cent: 20),
- merchant: merchant,
- merchantPub: "merchantPub",
- deliveryDate: nil,
- deliveryLocation: nil,
- exchanges: [],
- products: [product],
- refundDeadline: Timestamp.tomorrow(),
- wireTransferDeadline:
Timestamp.tomorrow(),
- timestamp: Timestamp.now(),
- orderID: "orderID",
- merchantBaseURL: "merchantBaseURL",
- fulfillmentURL: "fulfillmentURL",
- publicReorderURL:
"publicReorderURL",
- fulfillmentMessage: nil,
- fulfillmentMessageI18n: nil,
- wireFeeAmortization: 0,
- maxWireFee: Amount(currency:
LONGCURRENCY, cent: 20),
- minimumAge: nil
-// extra: extra,
-// auditors: [],
+ amount: Amount(currency:
LONGCURRENCY, cent: 220),
+ payDeadline: Timestamp.tomorrow(),
+ maxFee: Amount(currency:
LONGCURRENCY, cent: 20),
+ merchant: merchant,
+ merchantPub: "merchantPub",
+ deliveryDate: nil,
+ deliveryLocation: nil,
+ exchanges: [],
+ products: [product],
+ refundDeadline: Timestamp.tomorrow(),
+ wireTransferDeadline: Timestamp.tomorrow(),
+ timestamp: Timestamp.now(),
+ orderID: "orderID",
+ merchantBaseURL: "merchantBaseURL",
+ fulfillmentURL: "fulfillmentURL",
+ publicReorderURL: "publicReorderURL",
+ fulfillmentMessage: nil,
+ fulfillmentMessageI18n: nil,
+ wireFeeAmortization: 0,
+ maxWireFee: Amount(currency:
LONGCURRENCY, cent: 20),
+ minimumAge: nil
+// extra: extra,
+// auditors: []
)
- let details = PreparePayResult(
- status: PreparePayResultType.paymentPossible,
- transactionId: "txn:payment:012345",
- contractTerms: terms,
- contractTermsHash: "termsHash",
- amountRaw: Amount(currency: LONGCURRENCY, cent: 220),
- amountEffective: Amount(currency: LONGCURRENCY, cent: 240),
- balanceDetails: nil,
- paid: nil
-// , talerUri: "talerURI"
+ let details = PreparePayResult(status:
PreparePayResultType.paymentPossible,
+ transactionId: "txn:payment:012345",
+ contractTerms: terms,
+ contractTermsHash: "termsHash",
+ amountRaw: Amount(currency: LONGCURRENCY,
cent: 220),
+ amountEffective: Amount(currency: LONGCURRENCY,
cent: 240),
+ balanceDetails: nil,
+ paid: nil
+// , talerUri: "talerURI"
)
let url = URL(string: "taler://pay/some_amount")!
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 32/36: Shortcuts (50,25,10,5), (continued)
- [taler-taler-ios] 32/36: Shortcuts (50,25,10,5), gnunet, 2023/11/13
- [taler-taler-ios] 11/36: Debugging, gnunet, 2023/11/13
- [taler-taler-ios] 25/36: amountToTransfer Currency, gnunet, 2023/11/13
- [taler-taler-ios] 16/36: TransactionsArraySliceV, gnunet, 2023/11/13
- [taler-taler-ios] 20/36: amountToTransfer Request, gnunet, 2023/11/13
- [taler-taler-ios] 26/36: Minimalistic, gnunet, 2023/11/13
- [taler-taler-ios] 31/36: Use `te´and `ku´ for previews, gnunet, 2023/11/13
- [taler-taler-ios] 10/36: @Published currencyTicker, gnunet, 2023/11/13
- [taler-taler-ios] 35/36: Check Available, accessibility, gnunet, 2023/11/13
- [taler-taler-ios] 36/36: Bump version to 0.9.3 (25), gnunet, 2023/11/13
- [taler-taler-ios] 08/36: Cleanup,
gnunet <=