diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 11 |
1 files changed, 10 insertions, 1 deletions
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 { | |||
517 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); | 517 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); |
518 | } | 518 | } |
519 | 519 | ||
520 | @action _reorder({ oldIndex, newIndex }) { | 520 | @action _reorder(params) { |
521 | const { workspaces } = this.stores; | ||
522 | if (workspaces.isAnyWorkspaceActive) { | ||
523 | workspaces.reorderServicesOfActiveWorkspace(params); | ||
524 | } else { | ||
525 | this._reorderService(params); | ||
526 | } | ||
527 | } | ||
528 | |||
529 | @action _reorderService({ oldIndex, newIndex }) { | ||
521 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; | 530 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; |
522 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); | 531 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); |
523 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); | 532 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); |