diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-05-08 13:57:03 +0200 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-05-08 13:57:03 +0200 |
commit | 17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae (patch) | |
tree | 858835c95bc8022a98c932b0fa2fd793c5d6ec81 /src/features/workspaces/store.js | |
parent | fix debug message for announcement semver logic (diff) | |
download | ferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.tar.gz ferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.tar.zst ferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.zip |
fix(Workspaces): Service reordering within workspaces
Diffstat (limited to 'src/features/workspaces/store.js')
-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 e11513d1f..e0bef8aea 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 = () => { |