Skip to content

Commit

Permalink
disable store stuff for non store edition
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasr22 committed Sep 13, 2024
1 parent 3c667bc commit ea56a78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions BrightIntosh/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func isExtraBrightnessAllowed(offerUpgrade: Bool) async -> Bool {
#if STORE
if await EntitlementHandler.shared.isUnrestrictedUser() {
return true
}
Expand All @@ -57,6 +58,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
} catch {
return false
}
#else
return true
#endif
}

@objc func increaseBrightness() {
Expand Down
5 changes: 4 additions & 1 deletion BrightIntosh/UI/SettingsWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit ea56a78

Please sign in to comment.