gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 28/36: Cleanup property wrappers


From: gnunet
Subject: [taler-taler-ios] 28/36: Cleanup property wrappers
Date: Mon, 13 Nov 2023 21:27:33 +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 ed0c4f356a183fe84ac28364942448c384068a44
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Nov 13 07:05:32 2023 +0100

    Cleanup property wrappers
---
 TalerWallet1/Views/Balances/BalancesListView.swift               | 5 +++--
 TalerWallet1/Views/Balances/BalancesSectionView.swift            | 5 ++---
 TalerWallet1/Views/Exchange/ExchangeListView.swift               | 1 +
 TalerWallet1/Views/Exchange/ManualWithdraw.swift                 | 3 +--
 TalerWallet1/Views/HelperViews/BarGraph.swift                    | 3 ++-
 TalerWallet1/Views/HelperViews/CurrencyInputView.swift           | 1 +
 TalerWallet1/Views/Main/MainView.swift                           | 8 +++++---
 TalerWallet1/Views/Peer2peer/RequestPayment.swift                | 2 +-
 TalerWallet1/Views/Peer2peer/RequestPurpose.swift                | 6 ++++--
 TalerWallet1/Views/Peer2peer/SendAmount.swift                    | 3 ++-
 TalerWallet1/Views/Peer2peer/SendDoneV.swift                     | 3 +--
 TalerWallet1/Views/Settings/AboutView.swift                      | 1 -
 TalerWallet1/Views/Settings/SettingsView.swift                   | 3 +--
 TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift         | 2 +-
 TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift     | 2 +-
 TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift          | 5 ++---
 TalerWallet1/Views/Sheets/Payment/PaymentView.swift              | 5 ++---
 TalerWallet1/Views/Sheets/URLSheet.swift                         | 1 +
 .../Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift | 2 +-
 .../Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift    | 9 ++++-----
 20 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift 
b/TalerWallet1/Views/Balances/BalancesListView.swift
index 4640a9a..f7ee719 100644
--- a/TalerWallet1/Views/Balances/BalancesListView.swift
+++ b/TalerWallet1/Views/Balances/BalancesListView.swift
@@ -14,14 +14,15 @@ struct BalancesListView: View {
     let navTitle: String
     @Binding var balances: [Balance]
     @Binding var shouldReloadBalances: Int
-    @State private var lastReloadedBalances = 0
 #if TABBAR  // Taler Wallet
 #else       // GNU Taler
     let hamburgerAction: () -> Void
 #endif
 
     @EnvironmentObject private var model: WalletModel
-    @State private var amountToTransfer = Amount.zero(currency: "")            
 // Update when used
+
+    @State private var lastReloadedBalances = 0
+    @State private var amountToTransfer = Amount.zero(currency: "")            
 // 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/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 8d4d793..5d58670 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -22,13 +22,12 @@ struct BalancesSectionView {
     @Binding var amountToTransfer: Amount           // does still have the 
wrong currency
     @Binding var summary: String
 
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
-    @AppStorage("iconOnly") var iconOnly: Bool = false
     @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
+    @AppStorage("iconOnly") var iconOnly: Bool = false
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
 
     @State private var isShowingDetailView = false
-
     @State private var transactions: [Transaction] = []
     @State private var completedTransactions: [Transaction] = []
     @State private var pendingTransactions: [Transaction] = []
diff --git a/TalerWallet1/Views/Exchange/ExchangeListView.swift 
b/TalerWallet1/Views/Exchange/ExchangeListView.swift
index 8d34c3e..75b7156 100644
--- a/TalerWallet1/Views/Exchange/ExchangeListView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeListView.swift
@@ -17,6 +17,7 @@ struct ExchangeListView: View {
     var hamburgerAction: () -> Void
 #endif
     @EnvironmentObject private var model: WalletModel
+
     @State var showAlert: Bool = false
     @State var newExchange: String = TESTEXCHANGE
 
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index ec70a52..3e9c3bc 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -14,11 +14,10 @@ struct ManualWithdraw: View {
     let exchange: Exchange
     @Binding var amountToTransfer: Amount
 
-    @AppStorage("iconOnly") var iconOnly: Bool = false
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("iconOnly") var iconOnly: Bool = false
 
     @State var withdrawalAmountDetails: WithdrawalAmountDetails? = nil
-
 //    @State var ageMenuList: [Int] = []
 //    @State var selectedAge = 0
 
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift 
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index 9eb61dc..673f6ad 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -12,8 +12,9 @@ struct BarGraphHeader: View {
     let stack: CallStack
     let currency: String
 
-//    @AppStorage("moreContrast") var moreContrast: Bool = false
     @EnvironmentObject private var model: WalletModel
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
+
     @State private var completedTransactions: [Transaction] = []
 
     var body: some View {
diff --git a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift 
b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
index ef7dcc4..841a554 100644
--- a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
+++ b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
@@ -10,6 +10,7 @@ struct CurrencyInputView: View {
     let title: String
 
     @EnvironmentObject private var controller: Controller
+    
     @State var hasBeenShown = false
 
     var body: some View {
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 65f0dcd..a1639ed 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -18,14 +18,16 @@ struct MainView: View {
     private let symLog = SymLogV(0)
     let logger: Logger
     let stack: CallStack
+    @Binding var soundPlayed: Bool
+
     @EnvironmentObject private var viewState: ViewState         // 
popToRootView()
     @EnvironmentObject private var controller: Controller
-    @State private var sheetPresented = false
-    @State private var urlToOpen: URL? = nil
-    @Binding var soundPlayed: Bool
     @AppStorage("talerFont") var talerFont: Int = 0         // extension 
mustn't define this, so it must be here
     @AppStorage("playSounds") var playSounds: Int = 1       // extension 
mustn't define this, so it must be here
 
+    @State private var sheetPresented = false
+    @State private var urlToOpen: URL? = nil
+
     func sheetDismissed() -> Void {
         logger.info("sheet dismiss")
     }
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift 
b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
index 552114a..ef6a08f 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
+++ b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -14,8 +14,8 @@ struct RequestPayment: View {
     @Binding var amountToTransfer: Amount
     @Binding var summary: String
 
-    @AppStorage("iconOnly") var iconOnly: Bool = false
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("iconOnly") var iconOnly: Bool = false
 
     @State private var peerPullCheck: CheckPeerPullCreditResponse? = nil
     @State private var expireDays: UInt = 0
diff --git a/TalerWallet1/Views/Peer2peer/RequestPurpose.swift 
b/TalerWallet1/Views/Peer2peer/RequestPurpose.swift
index da20057..8562c52 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPurpose.swift
+++ b/TalerWallet1/Views/Peer2peer/RequestPurpose.swift
@@ -14,9 +14,11 @@ struct RequestPurpose: View {
     let fee: String
     @Binding var summary: String
     @Binding var expireDays: UInt
-    @AppStorage("iconOnly") var iconOnly: Bool = false
-    let navTitle = String(localized: "NavTitle_Request_Subject", defaultValue: 
"Request", comment: "NavTitle for entering the subject for Request-Payment")
+
     @EnvironmentObject private var controller: Controller
+    @AppStorage("iconOnly") var iconOnly: Bool = false
+    let navTitle = String(localized: "NavTitle_Request_Subject",
+                       defaultValue: "Request", comment: "NavTitle for 
entering the subject for Request-Payment")
 
     @State private var transactionStarted: Bool = false
     @FocusState private var isFocused: Bool
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index 7ab91d8..ba9068a 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -15,8 +15,9 @@ struct SendAmount: View {
     @Binding var amountToTransfer: Amount
     @Binding var summary: String
 
-    @AppStorage("iconOnly") var iconOnly: Bool = false
+    @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("iconOnly") var iconOnly: Bool = false
 
     @State var peerPushCheck: CheckPeerPushDebitResponse? = nil
     @State private var expireDays: UInt = SEVENDAYS
diff --git a/TalerWallet1/Views/Peer2peer/SendDoneV.swift 
b/TalerWallet1/Views/Peer2peer/SendDoneV.swift
index 7584b3f..d7fdd45 100644
--- a/TalerWallet1/Views/Peer2peer/SendDoneV.swift
+++ b/TalerWallet1/Views/Peer2peer/SendDoneV.swift
@@ -11,6 +11,7 @@ struct SendDoneV: View {
     private let symLog = SymLogV()
     let stack: CallStack
     let navTitle = String(localized: "P2P Ready")
+    @EnvironmentObject private var model: WalletModel
 #if DEBUG
     @AppStorage("developerMode") var developerMode: Bool = true
 #else
@@ -24,8 +25,6 @@ struct SendDoneV: View {
     let expireDays: UInt
     @Binding var transactionStarted: Bool
 
-    @EnvironmentObject private var model: WalletModel
-
     @State private var transactionId: String? = nil
 
     func reloadOneAction(_ transactionId: String) async throws -> Transaction {
diff --git a/TalerWallet1/Views/Settings/AboutView.swift 
b/TalerWallet1/Views/Settings/AboutView.swift
index 2ad5d07..adf768d 100644
--- a/TalerWallet1/Views/Settings/AboutView.swift
+++ b/TalerWallet1/Views/Settings/AboutView.swift
@@ -21,7 +21,6 @@ struct AboutView: View {
     @AppStorage("iconOnly") var iconOnly: Bool = false
 
     @State private var rotationEnabled = false
-
     @State private var listID = UUID()
 
     var body: some View {
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index 360abde..ae34f61 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -21,6 +21,7 @@ struct SettingsView: View {
     let navTitle: String
 
     @EnvironmentObject private var controller: Controller
+    @EnvironmentObject private var model: WalletModel
 #if DEBUG
     @AppStorage("developerMode") var developerMode: Bool = true
 #else
@@ -39,8 +40,6 @@ struct SettingsView: View {
     var hamburgerAction: () -> Void
 #endif
 
-    @EnvironmentObject private var model: WalletModel
-
     @State private var checkDisabled = false
     @State private var withDrawDisabled = false
 #if DEBUG
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
index b26a6d0..0088fdc 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
@@ -14,8 +14,8 @@ struct P2pAcceptDone: View {
     let transactionId: String
     let incoming: Bool
 
-    @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
+    @EnvironmentObject private var model: WalletModel
 
     @State private var finished: Bool = false
 
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index 5086d56..4a39eca 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -12,12 +12,12 @@ struct P2pReceiveURIView: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
     let navTitle = String(localized: "P2P Receive")
-    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     // the scanned URL
     let url: URL
     
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     @State private var peerPushCreditResponse: PreparePeerPushCreditResponse?
 
diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift 
b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
index 7dda920..5a66006 100644
--- a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
@@ -13,13 +13,12 @@ struct PayTemplateView: View {
     let stack: CallStack
     let navTitle = String(localized: "Confirm Payment", comment:"pay merchant")
 
-    @EnvironmentObject private var controller: Controller
-    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
-
     // the scanned URL
     let url: URL
 
+    @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     func acceptAction(preparePayResult: PreparePayResult) {
         Task { // runs on MainActor
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift 
b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
index 50e9f2b..534a7d4 100644
--- a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
@@ -13,13 +13,12 @@ struct PaymentView: View {
     let stack: CallStack
     let navTitle = String(localized: "Confirm Payment", comment:"pay merchant")
 
-    @EnvironmentObject private var controller: Controller
-    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
-
     // the scanned URL
     let url: URL
 
+    @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     func acceptAction(preparePayResult: PreparePayResult) {
         Task { // runs on MainActor
diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift 
b/TalerWallet1/Views/Sheets/URLSheet.swift
index 4bb7a10..4c9f99d 100644
--- a/TalerWallet1/Views/Sheets/URLSheet.swift
+++ b/TalerWallet1/Views/Sheets/URLSheet.swift
@@ -10,6 +10,7 @@ struct URLSheet: View {
     let stack: CallStack
     let navTitle = String(localized: "Checking Link")
     var urlToOpen: URL
+
     @EnvironmentObject private var controller: Controller
 
     var body: some View {
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
index 0799c6c..048351d 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
@@ -14,8 +14,8 @@ struct WithdrawAcceptDone: View {
     let exchangeBaseUrl: String?
     let url: URL
 
-    @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
+    @EnvironmentObject private var model: WalletModel
 
     @State private var transactionId: String? = nil
 
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
index bf584a5..0142d42 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
@@ -8,19 +8,18 @@ import SymLog
 struct WithdrawTOSView: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
-    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     let navTitle = String(localized: "Terms of Service")
 
     let exchangeBaseUrl: String?
+    let viewID: Int         // either VIEW_WITHDRAW_TOS or SHEET_WITHDRAW_TOS
+    let acceptAction: (() -> Void)?
 
+    @Environment(\.presentationMode) var presentationMode
     @EnvironmentObject private var model: WalletModel
+    @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     @State var exchangeTOS: ExchangeTermsOfService?
-    let viewID: Int         // either VIEW_WITHDRAW_TOS or SHEET_WITHDRAW_TOS
-
-    let acceptAction: (() -> Void)?
-    @Environment(\.presentationMode) var presentationMode
 
     var body: some View {
         VStack {

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