diff options
author | 2019-05-22 12:42:25 +0200 | |
---|---|---|
committer | 2019-05-22 12:42:25 +0200 | |
commit | 6d69a41ed76ce8e3b21bd07911a13f5271009152 (patch) | |
tree | 159dd569bd133e5e1e5b2828ce64fd8bd3f14a56 /src/stores | |
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/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 17150a023..d63302fce 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -518,7 +518,16 @@ export default class ServicesStore extends Store { | |||
518 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); | 518 | this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); |
519 | } | 519 | } |
520 | 520 | ||
521 | @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 }) { | ||
522 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; | 531 | const showDisabledServices = this.stores.settings.all.app.showDisabledServices; |
523 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); | 532 | const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); |
524 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); | 533 | const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); |