diff options
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r-- | src/stores/ServicesStore.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 13f929c2f..d63302fce 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -291,7 +291,8 @@ export default class ServicesStore extends Store { | |||
291 | gaEvent('Service', 'clear cache'); | 291 | gaEvent('Service', 'clear cache'); |
292 | } | 292 | } |
293 | 293 | ||
294 | @action _setActive({ serviceId }) { | 294 | @action _setActive({ serviceId, keepActiveRoute }) { |
295 | if (!keepActiveRoute) this.stores.router.push('/'); | ||
295 | const service = this.one(serviceId); | 296 | const service = this.one(serviceId); |
296 | 297 | ||
297 | this.all.forEach((s, index) => { | 298 | this.all.forEach((s, index) => { |
@@ -517,7 +518,16 @@ export default class ServicesStore extends Store { | |||
517 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); | 518 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); |
518 | } | 519 | } |
519 | 520 | ||
520 | @action _reorder({ oldIndex, newIndex }) { | 521 | @action _reorder(params) { |
522 | const { workspaces } = this.stores; | ||
523 | if (workspaces.isAnyWorkspaceActive) { | ||
524 | workspaces.reorderServicesOfActiveWorkspace(params); | ||
525 | } else { | ||
526 | this._reorderService(params); | ||
527 | } | ||
528 | } | ||
529 | |||
530 | @action _reorderService({ oldIndex, newIndex }) { | ||
521 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; | 531 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; |
522 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); | 532 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); |
523 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); | 533 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); |