Disable tag for previews
Some checks failed
gitea-openium/resgen.swift/pipeline/pr-master There was a failure building this commit

This commit is contained in:
Quentin Bandera 2024-12-17 16:30:22 +01:00
parent 2ec4ebcc66
commit 9a05ce29b8

View File

@ -78,12 +78,20 @@ class AnalyticsGenerator {
private static func getEnabledContent() -> String {
"""
private var isEnabled: Bool = true
private var isEnabled: Bool {
if ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" {
false
} else {
_isEnabled
}
}
private var _isEnabled: Bool = true
// MARK: - Methods
func setAnalyticsEnabled(_ enable: Bool) {
isEnabled = enable
_isEnabled = enable
}
"""
}