Gate detail diagnostics behind debug trigger

This commit is contained in:
FuelBoard Contributor
2026-10-14 07:54:32 +01:00
parent 6f177837a5
commit 4811b1cfa5
+4 -3
View File
@@ -536,11 +536,12 @@ struct ContentView: View {
/// Compiled in EVERY configuration: the detail sheet's `journeyDiagnostics`
/// argument is not conditional (an `#if` inside an argument list does not
/// build), so this symbol must exist for Release/Archive too. Only the panel
/// that renders it is `#if DEBUG`; Release returns nil and does no work.
/// build), so this symbol must exist for Release/Archive too. Debug builds
/// still require the hidden diagnostics trigger before doing any work;
/// Release returns nil and does no work.
private func journeyDiagnostics(for station: FuelStation, baseline: FuelStation?) -> FuelSavingsJourneyDiagnostics? {
#if DEBUG
guard let location else { return nil }
guard FuelStore.loadDebugMode(), let location else { return nil }
let stationDistance = FuelStore.roadDistanceDiagnostics(for: station, userLat: location.lat, userLng: location.lng)
let baselineDiagnostics = baseline.map { FuelStore.roadDistanceDiagnostics(for: $0, userLat: location.lat, userLng: location.lng) }
let journey = savingsJourneyMiles(for: station, location: location)