Store characters in the order specified in the script.

This corrects issue #38 by following the script sequence (not the
catalogue of characters) for storing the characters.
This commit is contained in:
Ben Finney 2020-06-24 22:40:01 +10:00
parent 8aebece218
commit ac475e39ce
1 changed files with 6 additions and 4 deletions

View File

@ -100,10 +100,12 @@ export default new Vuex.Store({
},
setRoles(state, roleIds) {
state.roles = new Map(
rolesJSON
.filter(r => roleIds.includes(r.id))
.sort((a, b) => b.team.localeCompare(a.team))
.map(role => [role.id, role])
roleIds
.filter(roleId => rolesJSONbyId.has(roleId))
.sort((a, b) =>
rolesJSONbyId.get(b).team.localeCompare(rolesJSONbyId.get(a).team)
)
.map(roleId => [roleId, rolesJSONbyId.get(roleId)])
);
},
setEdition(state, edition) {