diff options
author | 2019-06-12 11:35:22 +0200 | |
---|---|---|
committer | 2019-06-12 11:35:22 +0200 | |
commit | 98910182bb1316c02865bebe2e4e3a00fbba3f0a (patch) | |
tree | 1546e5a602b4b1c39df102459d11c4c1d4893036 /src/stores/ServicesStore.js | |
parent | Update CHANGELOG.md (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-98910182bb1316c02865bebe2e4e3a00fbba3f0a.tar.gz ferdium-app-98910182bb1316c02865bebe2e4e3a00fbba3f0a.tar.zst ferdium-app-98910182bb1316c02865bebe2e4e3a00fbba3f0a.zip |
Merge pull request #1472 from meetfranz/release/5.2.0-beta.1
5.2.0 beta.1
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]); |