Gate detail diagnostics behind debug trigger
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user