From 2243edb4aa8d837332e9727217983ec4fe334b58 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 4 Apr 2019 15:59:09 +0200 Subject: fix bug in workspace feature initialization --- src/features/workspaces/store.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 4d65712a7..7bd969be0 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -19,9 +19,11 @@ const debug = require('debug')('Franz:feature:workspaces:store'); export default class WorkspacesStore extends FeatureStore { @observable isFeatureEnabled = false; + @observable isFeatureActive = false; + @observable isPremiumFeature = true; - @observable isFeatureActive = false; + @observable isPremiumUpgradeRequired = true; @observable activeWorkspace = null; @@ -46,10 +48,6 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; } - @computed get isPremiumUpgradeRequired() { - return this.isFeatureEnabled && !this.isFeatureActive; - } - start(stores, actions) { debug('WorkspacesStore::start'); this.stores = stores; @@ -194,8 +192,11 @@ export default class WorkspacesStore extends FeatureStore { }; _setIsPremiumFeatureReaction = () => { - const { isWorkspacePremiumFeature } = this.stores.features.features; + const { features, user } = this.stores; + const { isPremium } = user.data; + const { isWorkspacePremiumFeature } = features.features; this.isPremiumFeature = isWorkspacePremiumFeature; + this.isPremiumUpgradeRequired = isWorkspacePremiumFeature && !isPremium; }; _setWorkspaceBeingEditedReaction = () => { -- cgit v1.2.3-54-g00ecf