cleaning up code pulling non edition travellers in to the role modal and fixing spelling of travellers

This commit is contained in:
Dave 2021-01-09 00:21:45 +00:00
parent 0df7d8386d
commit ea574fcc58
2 changed files with 5 additions and 16 deletions

View File

@ -21,7 +21,7 @@
<Token :role="role" />
</li>
<li
v-for="role in extraTravelers"
v-for="role in extraTravellers"
:class="[role.team]"
:key="role.id"
@click="setRole(role)"
@ -41,19 +41,8 @@ export default {
components: { Token, Modal },
props: ["playerIndex"],
computed: {
extraTravelers() {
const extraTravelers = [];
const players = this.$store.state.players.players;
this.$store.state.extraTravelers.forEach(role => {
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 = [];

View File

@ -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: {