From 17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 8 May 2019 13:57:03 +0200 Subject: fix(Workspaces): Service reordering within workspaces --- src/stores/ServicesStore.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/stores') diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 13f929c2f..d22a943d6 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -517,7 +517,16 @@ export default class ServicesStore extends Store { this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); } - @action _reorder({ oldIndex, newIndex }) { + @action _reorder(params) { + const { workspaces } = this.stores; + if (workspaces.isAnyWorkspaceActive) { + workspaces.reorderServicesOfActiveWorkspace(params); + } else { + this._reorderService(params); + } + } + + @action _reorderService({ oldIndex, newIndex }) { const showDisabledServices = this.stores.settings.all.app.showDisabledServices; const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); -- cgit v1.2.3-70-g09d2