From 75250402c88765d6ab7c78e1b4653f02f483a012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 22:14:36 +0200 Subject: [PATCH] fix ordering of social actions --- .../public/vuejs/Activity/components/SocialIssuesAcc.vue | 2 +- .../Resources/public/vuejs/Activity/store.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue index dc092062b..4691a860a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -111,7 +111,7 @@ export default { return this.$store.state.socialIssuesOther; }, socialActionsList() { - return this.$store.state.socialActionsList + return this.$store.getters.socialActionsListSorted; }, socialActionsSelected() { return this.$store.state.activity.socialActions; diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index 9a277a326..ca56a5dae 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -101,6 +101,9 @@ const store = createStore({ state.activity.activityType.thirdPartiesVisible !== 0) ); }, + socialActionsListSorted(state) { + return [ ...state.socialActionsList].sort((a, b) => a.ordering - b.ordering); + }, }, mutations: { // SocialIssueAcc @@ -132,7 +135,6 @@ const store = createStore({ }, addActionInList(state, action) { state.socialActionsList.push(action); - state.socialActionsList = state.socialActionsList.sort((a, b) => a.ordering-b.ordering); }, updateActionsSelected(state, actions) { //console.log('update actions selected', actions);