mirror of https://github.com/bra1n/townsquare.git
making non edition travelers appear in roleModal
This commit is contained in:
parent
c1db6aa447
commit
0df7d8386d
|
@ -20,6 +20,14 @@
|
||||||
>
|
>
|
||||||
<Token :role="role" />
|
<Token :role="role" />
|
||||||
</li>
|
</li>
|
||||||
|
<li
|
||||||
|
v-for="role in extraTravelers"
|
||||||
|
:class="[role.team]"
|
||||||
|
:key="role.id"
|
||||||
|
@click="setRole(role)"
|
||||||
|
>
|
||||||
|
<Token :role="role" />
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -33,6 +41,20 @@ export default {
|
||||||
components: { Token, Modal },
|
components: { Token, Modal },
|
||||||
props: ["playerIndex"],
|
props: ["playerIndex"],
|
||||||
computed: {
|
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() {
|
availableRoles() {
|
||||||
const availableRoles = [];
|
const availableRoles = [];
|
||||||
const players = this.$store.state.players.players;
|
const players = this.$store.state.players.players;
|
||||||
|
|
Loading…
Reference in New Issue