From ea56a786b33a77c4fde334c56a94a3a118616d6f Mon Sep 17 00:00:00 2001 From: Niklas Rousset Date: Fri, 13 Sep 2024 11:36:54 +0200 Subject: [PATCH] disable store stuff for non store edition --- BrightIntosh/AppDelegate.swift | 4 ++++ BrightIntosh/UI/SettingsWindow.swift | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BrightIntosh/AppDelegate.swift b/BrightIntosh/AppDelegate.swift index 0ba9f06..d753d7e 100644 --- a/BrightIntosh/AppDelegate.swift +++ b/BrightIntosh/AppDelegate.swift @@ -43,6 +43,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { } func isExtraBrightnessAllowed(offerUpgrade: Bool) async -> Bool { +#if STORE if await EntitlementHandler.shared.isUnrestrictedUser() { return true } @@ -57,6 +58,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { } catch { return false } +#else + return true +#endif } @objc func increaseBrightness() { diff --git a/BrightIntosh/UI/SettingsWindow.swift b/BrightIntosh/UI/SettingsWindow.swift index 0728bdc..8b40910 100644 --- a/BrightIntosh/UI/SettingsWindow.swift +++ b/BrightIntosh/UI/SettingsWindow.swift @@ -168,11 +168,12 @@ struct Acknowledgments: View { struct VersionView: View { #if STORE var title: String = "BrightIntosh SE v\(appVersion)" + @Environment(\.isUnrestrictedUser) private var isUnrestrictedUser: Bool #else var title: String = "BrightIntosh v\(appVersion)" + private let isUnrestrictedUser: Bool = true #endif - @Environment(\.isUnrestrictedUser) private var isUnrestrictedUser: Bool @State var clicks = 0 @@ -210,11 +211,13 @@ struct SettingsTabs: View { var body: some View { TabView { +#if STORE if !isUnrestrictedUser { BrightIntoshStoreView(showTrialExpiredWarning: true).tabItem { Text("Store") } } +#endif BasicSettings().tabItem { Text("General") }