diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-05-22 12:42:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-22 12:42:25 +0200 |
commit | 6d69a41ed76ce8e3b21bd07911a13f5271009152 (patch) | |
tree | 159dd569bd133e5e1e5b2828ce64fd8bd3f14a56 /src/features | |
parent | Merge pull request #1426 from meetfranz/fix/announcement-not-shown-within-wor... (diff) | |
parent | fix(Workspaces): Service reordering within workspaces (diff) | |
download | ferdium-app-6d69a41ed76ce8e3b21bd07911a13f5271009152.tar.gz ferdium-app-6d69a41ed76ce8e3b21bd07911a13f5271009152.tar.zst ferdium-app-6d69a41ed76ce8e3b21bd07911a13f5271009152.zip |
Merge pull request #1425 from meetfranz/fix/workspace-services-ordering-bug
Fix service reordering within workspaces
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 = () => { |