diff options
author | 2019-04-04 15:59:09 +0200 | |
---|---|---|
committer | 2019-04-04 15:59:09 +0200 | |
commit | 2243edb4aa8d837332e9727217983ec4fe334b58 (patch) | |
tree | f511941c9ad1c2a7ab107b9adb169533670ab96c /src/features/workspaces/store.js | |
parent | fix wrong workspace tooltip shortcut in sidebar (diff) | |
download | ferdium-app-2243edb4aa8d837332e9727217983ec4fe334b58.tar.gz ferdium-app-2243edb4aa8d837332e9727217983ec4fe334b58.tar.zst ferdium-app-2243edb4aa8d837332e9727217983ec4fe334b58.zip |
fix bug in workspace feature initialization
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r-- | src/features/workspaces/store.js | 13 |
1 files changed, 7 insertions, 6 deletions
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'); | |||
19 | export default class WorkspacesStore extends FeatureStore { | 19 | export default class WorkspacesStore extends FeatureStore { |
20 | @observable isFeatureEnabled = false; | 20 | @observable isFeatureEnabled = false; |
21 | 21 | ||
22 | @observable isFeatureActive = false; | ||
23 | |||
22 | @observable isPremiumFeature = true; | 24 | @observable isPremiumFeature = true; |
23 | 25 | ||
24 | @observable isFeatureActive = false; | 26 | @observable isPremiumUpgradeRequired = true; |
25 | 27 | ||
26 | @observable activeWorkspace = null; | 28 | @observable activeWorkspace = null; |
27 | 29 | ||
@@ -46,10 +48,6 @@ export default class WorkspacesStore extends FeatureStore { | |||
46 | return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; | 48 | return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; |
47 | } | 49 | } |
48 | 50 | ||
49 | @computed get isPremiumUpgradeRequired() { | ||
50 | return this.isFeatureEnabled && !this.isFeatureActive; | ||
51 | } | ||
52 | |||
53 | start(stores, actions) { | 51 | start(stores, actions) { |
54 | debug('WorkspacesStore::start'); | 52 | debug('WorkspacesStore::start'); |
55 | this.stores = stores; | 53 | this.stores = stores; |
@@ -194,8 +192,11 @@ export default class WorkspacesStore extends FeatureStore { | |||
194 | }; | 192 | }; |
195 | 193 | ||
196 | _setIsPremiumFeatureReaction = () => { | 194 | _setIsPremiumFeatureReaction = () => { |
197 | const { isWorkspacePremiumFeature } = this.stores.features.features; | 195 | const { features, user } = this.stores; |
196 | const { isPremium } = user.data; | ||
197 | const { isWorkspacePremiumFeature } = features.features; | ||
198 | this.isPremiumFeature = isWorkspacePremiumFeature; | 198 | this.isPremiumFeature = isWorkspacePremiumFeature; |
199 | this.isPremiumUpgradeRequired = isWorkspacePremiumFeature && !isPremium; | ||
199 | }; | 200 | }; |
200 | 201 | ||
201 | _setWorkspaceBeingEditedReaction = () => { | 202 | _setWorkspaceBeingEditedReaction = () => { |