From ea574fcc58ebaa085f5a8812ec0482e01f825782 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 9 Jan 2021 00:21:45 +0000 Subject: [PATCH] cleaning up code pulling non edition travellers in to the role modal and fixing spelling of travellers --- src/components/modals/RoleModal.vue | 17 +++-------------- src/store/index.js | 4 ++-- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/components/modals/RoleModal.vue b/src/components/modals/RoleModal.vue index 87f6d94..b55bd39 100644 --- a/src/components/modals/RoleModal.vue +++ b/src/components/modals/RoleModal.vue @@ -21,7 +21,7 @@
  • { - if ( - this.playerIndex >= 0 || - (this.playerIndex < 0 && - !players.some(player => player.role.id === role.id)) - ) { - extraTravelers.push(role); - } - }); - return extraTravelers; + extraTravellers() { + return [...this.$store.state.extraTravellers.values()]; }, availableRoles() { const availableRoles = []; diff --git a/src/store/index.js b/src/store/index.js index ac50082..61ea65c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -25,7 +25,7 @@ const getRolesByEdition = (edition = editionJSON[0]) => { ); }; -const getTravelersNotInEdition = (edition = editionJSON[0]) => { +const getTravellersNotInEdition = (edition = editionJSON[0]) => { return new Map( rolesJSON .filter(r => r.team === "traveler") @@ -79,7 +79,7 @@ export default new Vuex.Store({ }, edition: editionJSONbyId.get("tb"), roles: getRolesByEdition(), - extraTravelers: getTravelersNotInEdition(), + extraTravellers: getTravellersNotInEdition(), fabled }, getters: {