Skip to content

Commit

Permalink
Merge pull request #211 from TelemetryDeck/feature/analytics-disabled
Browse files Browse the repository at this point in the history
Respect SwiftUI previews & analyticsDisabled for internal signals
  • Loading branch information
Jeehut authored Dec 2, 2024
2 parents 2be7acf + be8d519 commit 90b4f13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/TelemetryDeck/TelemetryDeck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public enum TelemetryDeck {
let manager = TelemetryManager.shared
let configuration = manager.configuration

// make sure to not send any signals when run by Xcode via SwiftUI previews
guard !configuration.swiftUIPreviewMode, !configuration.analyticsDisabled else { return }

let prefixedDefaultParameters = configuration.defaultParameters().mapKeys { (configuration.defaultParameterPrefix ?? "") + $0 }
let combinedParameters = prefixedDefaultParameters.merging(parameters) { $1 }

Expand Down

0 comments on commit 90b4f13

Please sign in to comment.