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) { setRoles(state, roleIds) {
state.roles = new Map( state.roles = new Map(
rolesJSON roleIds
.filter(r => roleIds.includes(r.id)) .filter(roleId => rolesJSONbyId.has(roleId))
.sort((a, b) => b.team.localeCompare(a.team)) .sort((a, b) =>
.map(role => [role.id, role]) rolesJSONbyId.get(b).team.localeCompare(rolesJSONbyId.get(a).team)
)
.map(roleId => [roleId, rolesJSONbyId.get(roleId)])
); );
}, },
setEdition(state, edition) { setEdition(state, edition) {