taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit c114ddab3cf316cef105af1567170990f3bca999
parent 7095d51ce5d47ff5c56833857ec13106d59a9b24
Author: Marc Stibane <marc@taler.net>
Date:   Mon,  5 Oct 2026 08:03:43 +0200

persist showRealCashHint

Diffstat:
MTalerWallet1/Views/Balances/BalancesListView.swift | 2+-
MTalerWallet1/Views/Main/WalletEmptyView.swift | 9++++++---
MTalerWallet1/Views/Main/WalletMain.swift | 4+++-
3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift @@ -16,6 +16,7 @@ struct BalancesListView: View { let stack: CallStack let title: String @Binding var selectedBalance: Balance? // set in TransactionsListView + @Binding var showRealCashHint: Bool @Binding var reloadTransactions: Int @EnvironmentObject private var model: WalletModel @@ -28,7 +29,6 @@ struct BalancesListView: View { @State private var amountToTransfer = Amount.zero(currency: EMPTYSTRING) // Update currency when used @State private var summary = EMPTYSTRING - @State private var showRealCashHint = true @State private var historyTapped: Int? = nil @Namespace var namespace diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift b/TalerWallet1/Views/Main/WalletEmptyView.swift @@ -128,6 +128,7 @@ struct ProdSectionView: View { /// It is the very first thing the user sees after installing the app struct WalletEmptyHeader: View { let stack: CallStack + @Binding var showRealCashHint: Bool @EnvironmentObject private var controller: Controller @@ -138,7 +139,8 @@ struct WalletEmptyHeader: View { } var body: some View { - let emptyView = WalletEmptyView(stack: stack.push("isEmpty")) + let emptyView = WalletEmptyView(stack: stack.push("isEmpty"), + showRealCashHint: $showRealCashHint) // .navigationTitle("Taler Wallet") .refreshable { await refresh() @@ -204,6 +206,7 @@ struct WalletHeader<Content: View> : View { struct WalletEmptyView: View { private let symLog = SymLogV(0) let stack: CallStack + @Binding var showRealCashHint: Bool @EnvironmentObject private var controller: Controller @EnvironmentObject private var model: WalletModel @@ -211,7 +214,6 @@ struct WalletEmptyView: View { @AppStorage("preferredColorScheme") var preferredColorScheme: Int = 0 @State private var withDrawStarted = false @State private var urlToOpen: URL? = nil - @State private var showRealCashHint = true var body: some View { let list = List { @@ -288,6 +290,7 @@ struct WalletEmptyView: View { // MARK: - struct WalletEmptyView_Previews: PreviewProvider { static var previews: some View { - WalletEmptyView(stack: CallStack("Preview")) + WalletEmptyView(stack: CallStack("Preview"), + showRealCashHint: Binding.constant(true)) } } diff --git a/TalerWallet1/Views/Main/WalletMain.swift b/TalerWallet1/Views/Main/WalletMain.swift @@ -55,6 +55,7 @@ struct WalletMain: View { @State private var amountLastUsed = Amount.zero(currency: EMPTYSTRING) // Update currency when used @State private var summary: String = EMPTYSTRING @State private var iconID: String? = nil + @State private var showRealCashHint = true private var openKycButton: some View { Button("Legitimization") { @@ -175,7 +176,7 @@ struct WalletMain: View { let balancesStack = NavigationView { ZStack(alignment: .trailing) { if controller.balances.isEmpty { - WalletEmptyHeader(stack: stack.push()) + WalletEmptyHeader(stack: stack.push(), showRealCashHint: $showRealCashHint) } else { // if #available(iOS 17.0, *) { // CarouselView(stack: stack.push(balancesTitle), @@ -185,6 +186,7 @@ struct WalletMain: View { BalancesListView(stack: stack.push(balancesTitle), title: balancesTitle, selectedBalance: $selectedBalance, // needed for sheets, gets set in TransactionsListView + showRealCashHint: $showRealCashHint, reloadTransactions: $shouldReloadTransactions) .accessibilitySortPriority(1) // Reads third // } iOS 15 + 16