diff options
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r-- | src/features/workspaces/store.js | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 632f3c299..8c73516bc 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js | |||
@@ -22,10 +22,6 @@ export default class WorkspacesStore extends FeatureStore { | |||
22 | 22 | ||
23 | @observable isFeatureActive = false; | 23 | @observable isFeatureActive = false; |
24 | 24 | ||
25 | @observable isPremiumFeature = false; | ||
26 | |||
27 | @observable isPremiumUpgradeRequired = false; | ||
28 | |||
29 | @observable activeWorkspace = null; | 25 | @observable activeWorkspace = null; |
30 | 26 | ||
31 | @observable nextWorkspace = null; | 27 | @observable nextWorkspace = null; |
@@ -58,7 +54,6 @@ export default class WorkspacesStore extends FeatureStore { | |||
58 | 54 | ||
59 | @computed get isUserAllowedToUseFeature() { | 55 | @computed get isUserAllowedToUseFeature() { |
60 | return true; | 56 | return true; |
61 | // return !this.isPremiumUpgradeRequired; | ||
62 | } | 57 | } |
63 | 58 | ||
64 | @computed get isAnyWorkspaceActive() { | 59 | @computed get isAnyWorkspaceActive() { |
@@ -69,16 +64,8 @@ export default class WorkspacesStore extends FeatureStore { | |||
69 | 64 | ||
70 | _wasDrawerOpenBeforeSettingsRoute = null; | 65 | _wasDrawerOpenBeforeSettingsRoute = null; |
71 | 66 | ||
72 | _freeUserActions = []; | ||
73 | |||
74 | _premiumUserActions = []; | ||
75 | |||
76 | _allActions = []; | 67 | _allActions = []; |
77 | 68 | ||
78 | _freeUserReactions = []; | ||
79 | |||
80 | _premiumUserReactions = []; | ||
81 | |||
82 | _allReactions = []; | 69 | _allReactions = []; |
83 | 70 | ||
84 | // ========== PUBLIC API ========= // | 71 | // ========== PUBLIC API ========= // |
@@ -90,11 +77,9 @@ export default class WorkspacesStore extends FeatureStore { | |||
90 | 77 | ||
91 | // ACTIONS | 78 | // ACTIONS |
92 | 79 | ||
93 | this._freeUserActions = createActionBindings([ | 80 | this._allActions = createActionBindings([ |
94 | [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], | 81 | [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], |
95 | [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], | 82 | [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], |
96 | ]); | ||
97 | this._premiumUserActions = createActionBindings([ | ||
98 | [workspaceActions.edit, this._edit], | 83 | [workspaceActions.edit, this._edit], |
99 | [workspaceActions.create, this._create], | 84 | [workspaceActions.create, this._create], |
100 | [workspaceActions.delete, this._delete], | 85 | [workspaceActions.delete, this._delete], |
@@ -106,27 +91,18 @@ export default class WorkspacesStore extends FeatureStore { | |||
106 | this._toggleKeepAllWorkspacesLoadedSetting, | 91 | this._toggleKeepAllWorkspacesLoadedSetting, |
107 | ], | 92 | ], |
108 | ]); | 93 | ]); |
109 | this._allActions = this._freeUserActions.concat(this._premiumUserActions); | ||
110 | this._registerActions(this._allActions); | 94 | this._registerActions(this._allActions); |
111 | 95 | ||
112 | // REACTIONS | 96 | // REACTIONS |
113 | 97 | ||
114 | this._freeUserReactions = createReactions([ | 98 | this._allReactions = createReactions([ |
115 | this._disablePremiumFeatures, | ||
116 | this._openDrawerWithSettingsReaction, | 99 | this._openDrawerWithSettingsReaction, |
117 | this._setFeatureEnabledReaction, | 100 | this._setFeatureEnabledReaction, |
118 | this._setIsPremiumFeatureReaction, | ||
119 | this._cleanupInvalidServiceReferences, | 101 | this._cleanupInvalidServiceReferences, |
120 | ]); | ||
121 | this._premiumUserReactions = createReactions([ | ||
122 | this._setActiveServiceOnWorkspaceSwitchReaction, | 102 | this._setActiveServiceOnWorkspaceSwitchReaction, |
123 | this._activateLastUsedWorkspaceReaction, | 103 | this._activateLastUsedWorkspaceReaction, |
124 | this._setWorkspaceBeingEditedReaction, | 104 | this._setWorkspaceBeingEditedReaction, |
125 | ]); | 105 | ]); |
126 | this._allReactions = this._freeUserReactions.concat( | ||
127 | this._premiumUserReactions, | ||
128 | ); | ||
129 | |||
130 | this._registerReactions(this._allReactions); | 106 | this._registerReactions(this._allReactions); |
131 | 107 | ||
132 | getUserWorkspacesRequest.execute(); | 108 | getUserWorkspacesRequest.execute(); |
@@ -273,13 +249,6 @@ export default class WorkspacesStore extends FeatureStore { | |||
273 | this.isFeatureEnabled = isWorkspaceEnabled; | 249 | this.isFeatureEnabled = isWorkspaceEnabled; |
274 | }; | 250 | }; |
275 | 251 | ||
276 | _setIsPremiumFeatureReaction = () => { | ||
277 | // const { features } = this.stores; | ||
278 | // const { isWorkspaceIncludedInCurrentPlan } = features.features; | ||
279 | // this.isPremiumFeature = !isWorkspaceIncludedInCurrentPlan; | ||
280 | // this.isPremiumUpgradeRequired = !isWorkspaceIncludedInCurrentPlan; | ||
281 | }; | ||
282 | |||
283 | _setWorkspaceBeingEditedReaction = () => { | 252 | _setWorkspaceBeingEditedReaction = () => { |
284 | const { pathname } = this.stores.router.location; | 253 | const { pathname } = this.stores.router.location; |
285 | const match = matchRoute('/settings/workspaces/edit/:id', pathname); | 254 | const match = matchRoute('/settings/workspaces/edit/:id', pathname); |
@@ -357,16 +326,4 @@ export default class WorkspacesStore extends FeatureStore { | |||
357 | }); | 326 | }); |
358 | }); | 327 | }); |
359 | }; | 328 | }; |
360 | |||
361 | _disablePremiumFeatures = () => { | ||
362 | if (!this.isUserAllowedToUseFeature) { | ||
363 | debug('_disablePremiumFeatures'); | ||
364 | this._stopActions(this._premiumUserActions); | ||
365 | this._stopReactions(this._premiumUserReactions); | ||
366 | this.reset(); | ||
367 | } else { | ||
368 | this._startActions(this._premiumUserActions); | ||
369 | this._startReactions(this._premiumUserReactions); | ||
370 | } | ||
371 | }; | ||
372 | } | 329 | } |