| | |
| | | case layoutExport |
| | | case unlimitedNotes |
| | | case persistentAppSorting |
| | | case customHotkeys |
| | | |
| | | var titleKey: String { |
| | | switch self { |
| | |
| | | return "pro.feature.notes" |
| | | case .persistentAppSorting: |
| | | return "pro.feature.sorting" |
| | | case .customHotkeys: |
| | | return "pro.feature.customHotkeys" |
| | | } |
| | | } |
| | | |
| | |
| | | return "pro.feature.notes.benefit" |
| | | case .persistentAppSorting: |
| | | return "pro.feature.sorting.benefit" |
| | | case .customHotkeys: |
| | | return "pro.feature.customHotkeys.benefit" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | static func isUnlocked(_ feature: ProFeature) -> Bool { |
| | | switch feature { |
| | | case .premiumThemes, .layoutImport, .layoutExport, .unlimitedNotes, .persistentAppSorting: |
| | | case .premiumThemes, .layoutImport, .layoutExport, .unlimitedNotes, .persistentAppSorting, .customHotkeys: |
| | | return accessState().isUnlocked |
| | | } |
| | | } |
| | |
| | | originalAppVersion: String? = nil, |
| | | originalPurchaseDate: Date? = nil |
| | | ) { |
| | | let previousState = accessState |
| | | accessState = state |
| | | ProEntitlementSnapshotStore.update { snapshot in |
| | | snapshot.accessState = state |
| | | } |
| | | |
| | | if previousState != state { |
| | | NotificationCenter.default.post(name: .tagLauncherProEntitlementChanged, object: nil) |
| | | } |
| | | |
| | | if persistCache { |
| | | writeCache( |
| | | ProEntitlementCache( |