aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-05-08 13:57:03 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-05-08 13:57:03 +0200
commit17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae (patch)
tree858835c95bc8022a98c932b0fa2fd793c5d6ec81 /src/stores
parentfix debug message for announcement semver logic (diff)
downloadferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.tar.gz
ferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.tar.zst
ferdium-app-17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae.zip
fix(Workspaces): Service reordering within workspaces
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/ServicesStore.js11
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]);