diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ac012..9521e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/components/modals/GameStateModal.vue b/src/components/modals/GameStateModal.vue index 85ba304..7cfa494 100644 --- a/src/components/modals/GameStateModal.vue +++ b/src/components/modals/GameStateModal.vue @@ -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) || + {} })) ); } diff --git a/src/store/index.js b/src/store/index.js index bf53170..00a55ef 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -102,7 +102,8 @@ export default new Vuex.Store({ } }); return customRoles; - } + }, + rolesJSONbyId: () => rolesJSONbyId }, mutations: { toggleMenu({ grimoire }) { diff --git a/src/store/persistence.js b/src/store/persistence.js index 36ea006..59f4103 100644 --- a/src/store/persistence.js +++ b/src/store/persistence.js @@ -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) || + {} })) ); }