diff --git a/src/components/modals/RoleModal.vue b/src/components/modals/RoleModal.vue index 395325a..2f53971 100644 --- a/src/components/modals/RoleModal.vue +++ b/src/components/modals/RoleModal.vue @@ -49,7 +49,7 @@ export default { availableRoles.push({}); return availableRoles; }, - ...mapState(["modals", "roles"]), + ...mapState(["modals", "roles", "session"]), ...mapState("players", ["players"]) }, methods: { @@ -61,6 +61,7 @@ export default { role }); } else { + if (this.session.isSpectator && role.team === "traveler") return; // assign to player const player = this.$store.state.players.players[this.playerIndex]; this.$store.commit("players/update", { @@ -105,4 +106,8 @@ ul.tokens li { z-index: 10; } } + +#townsquare.spectator ul.tokens li.traveler { + display: none; +} diff --git a/src/store/session.js b/src/store/session.js index 5d5d642..4362de1 100644 --- a/src/store/session.js +++ b/src/store/session.js @@ -110,6 +110,7 @@ class LiveSession { * @param channel */ connect(channel) { + this._store.commit("setPlayerCount", 0); this._isSpectator = this._store.state.session.isSpectator; this._open(channel); } @@ -118,6 +119,7 @@ class LiveSession { * Close the current session, if any. */ disconnect() { + this._store.commit("setPlayerCount", 0); if (this._socket) { this._send("bye", this._playerId); this._socket.close();