From 4aa97385794bbcb4548243c0e8faf0b505d0d9d9 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 10 Oct 2024 21:13:42 -0400 Subject: [PATCH] Fix isAutomaticConnectionEnabled --- CHANGELOG.md | 4 ++++ Demo/Sources/iOS/Pulse_Demo_iOSApp.swift | 2 +- Sources/Pulse/RemoteLogger/RemoteLogger.swift | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3315fa6f1..df83bed47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Pulse 5.x +## Pulse 5.1.2 + +- Fix an issue with `isAutomaticConnectionEnabled` not starting the browser the first time it's enabled + ## Pulse 5.1.1 *Sep 19, 2024* diff --git a/Demo/Sources/iOS/Pulse_Demo_iOSApp.swift b/Demo/Sources/iOS/Pulse_Demo_iOSApp.swift index 863d1d533..95e7afd01 100644 --- a/Demo/Sources/iOS/Pulse_Demo_iOSApp.swift +++ b/Demo/Sources/iOS/Pulse_Demo_iOSApp.swift @@ -26,7 +26,7 @@ private final class AppViewModel: ObservableObject { // This code registers the store with the `RemoteLogger` (important!) LoggerStore.shared = .demo - RemoteLogger.shared.isAutomaticConnectionEnabled = true + // RemoteLogger.shared.isAutomaticConnectionEnabled = true // NetworkLogger.enableProxy() diff --git a/Sources/Pulse/RemoteLogger/RemoteLogger.swift b/Sources/Pulse/RemoteLogger/RemoteLogger.swift index 4072fc2f3..aee90ecf1 100644 --- a/Sources/Pulse/RemoteLogger/RemoteLogger.swift +++ b/Sources/Pulse/RemoteLogger/RemoteLogger.swift @@ -111,7 +111,8 @@ public final class RemoteLogger: ObservableObject, RemoteLoggerConnectionDelegat /// requires Bluetooth, it will trigger a prompt on the first app run. public var isAutomaticConnectionEnabled = false { didSet { - isEnabled = true + guard isAutomaticConnectionEnabled else { return } + enable() } }