mirror of
https://github.com/caprover/caprover
synced 2026-09-27 17:15:38 +00:00
Fixed feature flags
This commit is contained in:
@@ -6,8 +6,8 @@ import Logger from '../utils/Logger'
|
||||
export default class FeatureFlags {
|
||||
static instance: FeatureFlags
|
||||
|
||||
featureFlags: any | undefined
|
||||
static IS_PRO_ENABLED: 'isProEnabled'
|
||||
private featureFlags: any | undefined
|
||||
static IS_PRO_ENABLED = 'isProEnabled'
|
||||
|
||||
static get(datastore: DataStore) {
|
||||
if (!FeatureFlags.instance) {
|
||||
@@ -22,6 +22,10 @@ export default class FeatureFlags {
|
||||
self.featureFlags = self.datastore.getFeatureFlags()
|
||||
}
|
||||
|
||||
getFeatureFlags(): any | undefined {
|
||||
return this.featureFlags
|
||||
}
|
||||
|
||||
private refreshFeatureFlags() {
|
||||
const self = this
|
||||
Promise.resolve() //
|
||||
|
||||
@@ -127,13 +127,11 @@ export default class ProManager {
|
||||
return self.proDataStore.getApiKey()
|
||||
})
|
||||
.then(function (apiKey) {
|
||||
const flags = self.featureFlagsProvider.getFeatureFlags()
|
||||
return {
|
||||
isSubscribed: !!apiKey,
|
||||
isFeatureFlagEnabled:
|
||||
self.featureFlagsProvider.featureFlags &&
|
||||
self.featureFlagsProvider.featureFlags[
|
||||
FeatureFlags.IS_PRO_ENABLED
|
||||
],
|
||||
flags && flags[FeatureFlags.IS_PRO_ENABLED],
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user