fix ordering of social actions

This commit is contained in:
Julien Fastré 2022-04-25 22:14:36 +02:00
parent e5209ca6d9
commit 75250402c8
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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);