diff options
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/workspaces/store.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 3d7043413..51a7f3651 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js | |||
@@ -57,6 +57,10 @@ export default class WorkspacesStore extends FeatureStore { | |||
57 | return !this.isPremiumUpgradeRequired; | 57 | return !this.isPremiumUpgradeRequired; |
58 | } | 58 | } |
59 | 59 | ||
60 | @computed get isAnyWorkspaceActive() { | ||
61 | return !!this.activeWorkspace; | ||
62 | } | ||
63 | |||
60 | // ========== PRIVATE PROPERTIES ========= // | 64 | // ========== PRIVATE PROPERTIES ========= // |
61 | 65 | ||
62 | _wasDrawerOpenBeforeSettingsRoute = null; | 66 | _wasDrawerOpenBeforeSettingsRoute = null; |
@@ -229,6 +233,14 @@ export default class WorkspacesStore extends FeatureStore { | |||
229 | this.actions.ui.openSettings({ path: 'workspaces' }); | 233 | this.actions.ui.openSettings({ path: 'workspaces' }); |
230 | }; | 234 | }; |
231 | 235 | ||
236 | @action reorderServicesOfActiveWorkspace = async ({ oldIndex, newIndex }) => { | ||
237 | const { activeWorkspace } = this; | ||
238 | const { services } = activeWorkspace; | ||
239 | // Move services from the old to the new position | ||
240 | services.splice(newIndex, 0, services.splice(oldIndex, 1)[0]); | ||
241 | await updateWorkspaceRequest.execute(activeWorkspace); | ||
242 | }; | ||
243 | |||
232 | // Reactions | 244 | // Reactions |
233 | 245 | ||
234 | _setFeatureEnabledReaction = () => { | 246 | _setFeatureEnabledReaction = () => { |