load roles from gamestate that belong to different editions (like travelers)

This commit is contained in:
Steffen 2020-12-23 21:18:35 +01:00
parent 984c02980c
commit efa4a0fa4b
4 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# Release Notes
## Version 2.0.3
- load roles that belong to different editions (like travelers) from gamestate
- close session when missing custom roles and open edition modal
- added a few more metrics

View File

@ -92,7 +92,10 @@ export default {
"players/set",
players.map(player => ({
...player,
role: this.$store.state.roles.get(player.role) || {}
role:
this.$store.state.roles.get(player.role) ||
this.$store.getters.rolesJSONbyId.get(player.role) ||
{}
}))
);
}

View File

@ -102,7 +102,8 @@ export default new Vuex.Store({
}
});
return customRoles;
}
},
rolesJSONbyId: () => rolesJSONbyId
},
mutations: {
toggleMenu({ grimoire }) {

View File

@ -21,7 +21,8 @@ module.exports = store => {
JSON.parse(localStorage.bluffs).forEach((role, index) => {
store.commit("players/setBluff", {
index,
role: store.state.roles.get(role) || {}
role:
store.state.roles.get(role) || {}
});
});
}
@ -37,7 +38,10 @@ module.exports = store => {
"players/set",
JSON.parse(localStorage.players).map(player => ({
...player,
role: store.state.roles.get(player.role) || {}
role:
store.state.roles.get(player.role) ||
store.getters.rolesJSONbyId.get(player.role) ||
{}
}))
);
}