commit c0636cfc3739bffd60864588d7c3315ccf628638
parent 1e16b4a6bbd40dc32c3596bc2150795c433bfa5d
Author: Marc Stibane <marc@taler.net>
Date: Thu, 11 Jun 2026 10:22:09 +0200
LocalConsole only iOS16+
Diffstat:
2 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/TalerWallet1/Backend/WalletCore.swift b/TalerWallet1/Backend/WalletCore.swift
@@ -360,10 +360,12 @@ extension WalletCore {
if let event = payload.event, let json = event.toJSON() {
let type = event["type"]?.value as? String
let eventID = event["id"]?.value as? String
- observe(json: json,
- type: type,
- eventID: eventID,
- timestamp: timestamp)
+ if #available(iOS 16.0, *) {
+ observe(json: json,
+ type: type,
+ eventID: eventID,
+ timestamp: timestamp)
+ }
}
}
// TODO: remove these once wallet-core doesn't send them anymore
@@ -382,12 +384,15 @@ extension WalletCore {
}
@MainActor func handleLog(message: String) {
- if isLogging {
- let consoleManager = LCManager.shared
- consoleManager.print(message)
+ if #available (iOS 16.0, *) {
+ if isLogging {
+ let consoleManager = LCManager.shared
+ consoleManager.print(message)
+ }
}
}
+ @available(iOS 16.0, *)
@MainActor func observe(json: String, type: String?, eventID: String?, timestamp: String) {
let consoleManager = LCManager.shared
if let type {
diff --git a/TalerWallet1/Views/Settings/DebugSettingsView.swift b/TalerWallet1/Views/Settings/DebugSettingsView.swift
@@ -75,24 +75,26 @@ struct DebugSettingsView: View {
id1: "logTransactions",
description: String("full log with all tx"))
#endif
- let localConsStr = String("on LocalConsole")
- let observability = String("Observe walletCore")
- SettingsTriState(name: observability, value: $localConsoleO.onChange({ isObserving in
- walletCore.isObserving = isObserving}),
- id1: "observe",
- description: localConsStr) { isObserving in
- let consoleManager = LCManager.shared
- consoleManager.isVisible = localConsoleO != 0 || localConsoleL
- consoleManager.clear()
- }
- let showLogs = String("Show logs")
- SettingsToggle(name: showLogs, value: $localConsoleL.onChange({ isLogging in
- walletCore.isLogging = isLogging}),
- id1: "localConsoleL",
- description: localConsStr) { _ in
- let consoleManager = LCManager.shared
- consoleManager.isVisible = localConsoleO != 0 || localConsoleL
- consoleManager.clear()
+ if #available (iOS 16.0, *) {
+ let localConsStr = String("on LocalConsole")
+ let observability = String("Observe walletCore")
+ SettingsTriState(name: observability, value: $localConsoleO.onChange({ isObserving in
+ walletCore.isObserving = isObserving}),
+ id1: "observe",
+ description: localConsStr) { isObserving in
+ let consoleManager = LCManager.shared
+ consoleManager.isVisible = localConsoleO != 0 || localConsoleL
+ consoleManager.clear()
+ }
+ let showLogs = String("Show logs")
+ SettingsToggle(name: showLogs, value: $localConsoleL.onChange({ isLogging in
+ walletCore.isLogging = isLogging}),
+ id1: "localConsoleL",
+ description: localConsStr) { _ in
+ let consoleManager = LCManager.shared
+ consoleManager.isVisible = localConsoleO != 0 || localConsoleL
+ consoleManager.clear()
+ }
}
SettingsToggle(name: String(localized: "Show view sizes"), value: $debugViews,
id1: "debugViews",