correcting pronoun to pronouns in all occurances

This commit is contained in:
Dave 2021-02-28 11:23:16 +00:00
parent 0ffde84188
commit 769c891a67
4 changed files with 27 additions and 24 deletions

View File

@ -104,8 +104,8 @@
:class="{ active: isMenuOpen }"
>
{{ player.name }}
<div class="pronouns" v-if="player.pronoun && player.pronoun !== ''">
{{ player.pronoun }}
<div class="pronouns" v-if="player.pronouns && player.pronouns !== ''">
{{ player.pronouns }}
</div>
</div>
@ -154,7 +154,7 @@
<template v-else> Seat occupied</template>
</li>
<li
@click="changePronoun"
@click="changePronouns"
v-if="session.isSpectator && player.id === session.playerId"
>
<font-awesome-icon icon="transgender" />Change Pronouns
@ -241,13 +241,16 @@ export default {
};
},
methods: {
changePronoun() {
changePronouns() {
if (!this.session.isSpectator || this.player.id !== this.session.playerId)
return;
const pronoun = prompt("Player preffered pronouns", this.player.pronoun);
this.$store.commit("players/setPronoun", {
const pronouns = prompt(
"Player preffered pronouns",
this.player.pronouns
);
this.$store.commit("players/setPronouns", {
player: this.player,
pronoun
pronouns
});
this.isMenuOpen = false;
},

View File

@ -107,10 +107,10 @@ const mutations = {
state.players[index][property] = value;
}
},
setPronoun(state, { player, pronoun }) {
setPronouns(state, { player, pronouns }) {
const index = state.players.indexOf(player);
if (index >= 0) {
state.players[index].pronoun = pronoun;
state.players[index].pronouns = pronouns;
}
},
add(state, name) {

View File

@ -137,7 +137,7 @@ module.exports = store => {
case "players/set":
case "players/swap":
case "players/move":
case "players/setPronoun":
case "players/setPronouns":
if (state.players.players.length) {
localStorage.setItem(
"players",

View File

@ -189,8 +189,8 @@ class LiveSession {
case "bye":
this._handleBye(params);
break;
case "pronoun":
this._updatePlayerPronoun(params);
case "pronouns":
this._updatePlayerPronouns(params);
break;
}
}
@ -247,7 +247,7 @@ class LiveSession {
id: player.id,
isDead: player.isDead,
isVoteless: player.isVoteless,
pronoun: player.pronoun,
pronouns: player.pronouns,
...(player.role && player.role.team === "traveler"
? { roleId: player.role.id }
: {})
@ -308,7 +308,7 @@ class LiveSession {
const player = players[x];
const { roleId } = state;
// update relevant properties
["name", "id", "isDead", "isVoteless", "pronoun"].forEach(property => {
["name", "id", "isDead", "isVoteless", "pronouns"].forEach(property => {
const value = state[property];
if (player[property] !== value) {
this._store.commit("players/update", { player, property, value });
@ -486,26 +486,26 @@ class LiveSession {
}
/**
* Publish a player pronoun update
* Publish a player pronouns update
* @param player
* @param pronoun
* @param pronouns
*/
sendPlayerPronoun({ player, pronoun }) {
sendPlayerPronouns({ player, pronouns }) {
if (!this._isSpectator) return;
const index = this._store.state.players.players.indexOf(player);
this._send("pronoun", { index, pronoun });
this._send("pronouns", { index, pronouns });
}
/**
* Update a pronoun based on incoming data. Player only.
* Update a pronouns based on incoming data. Player only.
* @param index
* @param pronoun
* @param pronouns
* @private
*/
_updatePlayerPronoun({ index, pronoun }) {
_updatePlayerPronouns({ index, pronouns }) {
const player = this._store.state.players.players[index];
if (!player) return;
this._store.commit("players/setPronoun", { player, pronoun });
this._store.commit("players/setPronouns", { player, pronouns });
}
/**
@ -839,8 +839,8 @@ export default store => {
case "players/update":
session.sendPlayer(payload);
break;
case "players/setPronoun":
session.sendPlayerPronoun(payload);
case "players/setPronouns":
session.sendPlayerPronouns(payload);
break;
}
});