taler-ios

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

commit 56a80a4b2995f2f71584d860fb9fef42fb44b400
parent 09885e7548d71092cc1d7b935cb4892411551c02
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 29 Aug 2025 10:24:43 +0200

cleanup, DevExperiment

Diffstat:
MTalerWallet1/Views/Main/MainView.swift | 6+++---
MTalerWallet1/Views/OIM/OIMtransactions.swift | 4++--
MTalerWallet1/Views/Settings/Bank/BankEditView.swift | 2+-
MTalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift | 3---
MTalerWallet1/Views/Settings/SettingsView.swift | 2+-
MTalerWallet1/Views/Sheets/DevExperimentView.swift | 22++++++++++++++++++++--
MTalerWallet1/Views/Sheets/URLSheet.swift | 2+-
MTalerWallet1/Views/Transactions/TransactionRowView.swift | 2+-
8 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift @@ -253,11 +253,11 @@ struct MainView: View { } } } .onChange(of: controller.isConnected) { isConnected in if isConnected { - withAnimation(Animation.easeIn(duration: 1.0)) { + withAnimation(.easeIn(duration: 1.0)) { networkUnavailable = false } } else { - withAnimation(Animation.easeOut(duration: 1.0)) { + withAnimation(.easeOut(duration: 1.0)) { networkUnavailable = true } } @@ -314,7 +314,7 @@ extension Label where Title == Text, Icon == Image { self.init(EMPTYSTRING, systemImage: tab.a11y) } } -// MARK: - Content +// MARK: - struct ActionType: Hashable { let animationDisabled: Bool } diff --git a/TalerWallet1/Views/OIM/OIMtransactions.swift b/TalerWallet1/Views/OIM/OIMtransactions.swift @@ -10,7 +10,7 @@ import taler_swift enum OIMtransactionsState { case chestIsOpen - case chestOpenTapped // <- move mon + case chestOpenTapped // <- move money case balanceTapped case historyShown @@ -18,6 +18,7 @@ enum OIMtransactionsState { } +// MARK: - struct OIMhistoryItem: View { let talerTX: TalerTransaction @@ -61,7 +62,6 @@ struct OIMtransactions: View { @State private var availableVal: UInt64 = 0 @State private var available: Amount? = nil @State private var viewState: OIMtransactionsState = .chestIsOpen -// @State private var sending = false // after user tapped on Send or on the money @State private var closing = false // after user tapped on the open chest @State private var talerTXs: [TalerTransaction] = [] diff --git a/TalerWallet1/Views/Settings/Bank/BankEditView.swift b/TalerWallet1/Views/Settings/Bank/BankEditView.swift @@ -20,7 +20,7 @@ struct BankEditView: View { @EnvironmentObject private var controller: Controller @AppStorage("minimalistic") var minimalistic: Bool = false @AppStorage("demoHints") var demoHints: Bool = true - @AppStorage("fakeNoFees") var fakeNoFees: Bool = true +// @AppStorage("fakeNoFees") var fakeNoFees: Bool = true TODO: use this flag! @AppStorage("ownerName") var ownerName: String = EMPTYSTRING @State private var shouldReloadBalances: Int = 0 diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift @@ -62,9 +62,6 @@ struct ExchangeRowView: View { .onTapGesture { tabBarModel.tosView = index } -// .task { -// tabBarModel.tosView = false -// } }.listRowSeparator(.hidden) } } diff --git a/TalerWallet1/Views/Settings/SettingsView.swift b/TalerWallet1/Views/Settings/SettingsView.swift @@ -252,7 +252,7 @@ struct SettingsView: View { description: hideDescriptions ? nil : String("After each wallet-core action")) .id("delay") #if DEBUG - SettingsItem(name: String("Run Dev Experiment"), id1: "applyDevExperiment", + SettingsItem(name: String("Run Dev Experiment Refresh"), id1: "applyDevExperiment", description: hideDescriptions ? nil : "dev-experiment/insert-pending-refresh") { let title = "Refresh" Button(title) { diff --git a/TalerWallet1/Views/Sheets/DevExperimentView.swift b/TalerWallet1/Views/Sheets/DevExperimentView.swift @@ -16,20 +16,38 @@ struct DevExperimentView: View { let stack: CallStack let url: URL + @Environment(\.dismiss) var dismiss // pop back once @EnvironmentObject private var model: WalletModel @EnvironmentObject private var controller: Controller + @State private var finished = false @MainActor private func viewDidLoad() async { symLog.log(".task \(url.absoluteString)") try? await model.setConfig(setTesting: true) try? await model.devExperimentT(talerUri: url.absoluteString) + finished = true } var body: some View { - LoadingView(stack: stack.push(), scopeInfo: nil, message: url.host) - .task { await viewDidLoad() } + if finished { + VStack { + Spacer() + Text(url.absoluteString) + .talerFont(.title2) + .padding() + Spacer() + let title = "Finished" + Button(title) { + dismiss() + } + Spacer() + } + } else { + LoadingView(stack: stack.push(), scopeInfo: nil, message: url.absoluteString) + .task { await viewDidLoad() } + } } } #endif diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift b/TalerWallet1/Views/Sheets/URLSheet.swift @@ -66,7 +66,7 @@ struct URLSheet: View { DevExperimentView(stack: stack.push(), url: passedURL) #endif default: // TODO: Error view - let unknown = String(localized: "Unknown command") + let unknown = String(localized: "Unknown command: \(passedURL.absoluteString)") VStack { let _ = symLog.log("Unknown command❗️ \(passedURL.absoluteString)") Text(controller.messageForSheet ?? unknown) diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift @@ -94,7 +94,7 @@ struct TransactionRowView: View { var body: some View { #if DEBUG - let _ = Self._printChanges() +// let _ = Self._printChanges() let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear #endif let pending = transaction.isPending || transaction.common.isFinalizing