getting player pronouns to be synced over sockets layer

This commit is contained in:
Dave 2021-01-18 14:02:03 +00:00
parent 03731bc887
commit 48eab1fa8c
2 changed files with 3 additions and 1 deletions

View File

@ -245,6 +245,7 @@ export default {
prompt("Player preffered pronouns", this.player.pronoun) ||
this.player.pronoun;
this.updatePlayer("pronoun", pronoun, true);
this.$emit("trigger", ["updatePlayer", this.player, "pronoun", pronoun]);
},
toggleStatus() {
if (this.grimoire.isPublic) {

View File

@ -222,6 +222,7 @@ class LiveSession {
id: player.id,
isDead: player.isDead,
isVoteless: player.isVoteless,
pronoun: player.pronoun,
...(player.role && player.role.team === "traveler"
? { roleId: player.role.id }
: {})
@ -279,7 +280,7 @@ class LiveSession {
const player = players[x];
const { roleId } = state;
// update relevant properties
["name", "id", "isDead", "isVoteless"].forEach(property => {
["name", "id", "isDead", "isVoteless", "pronoun"].forEach(property => {
const value = state[property];
if (player[property] !== value) {
this._store.commit("players/update", { player, property, value });