From 0df7d8386d53e45b76eaf159676c1f6fc24b7fed Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 8 Jan 2021 18:35:22 +0000 Subject: [PATCH] making non edition travelers appear in roleModal --- src/components/modals/RoleModal.vue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/components/modals/RoleModal.vue b/src/components/modals/RoleModal.vue index cd0f520..87f6d94 100644 --- a/src/components/modals/RoleModal.vue +++ b/src/components/modals/RoleModal.vue @@ -20,6 +20,14 @@ > +
  • + +
  • @@ -33,6 +41,20 @@ 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; + }, availableRoles() { const availableRoles = []; const players = this.$store.state.players.players;