FIx Linting

This commit is contained in:
Pingumask 2024-02-04 23:49:34 +00:00
parent 3f666ce5f4
commit 2c24bd6e94
2 changed files with 23 additions and 22 deletions

View file

@ -40,8 +40,9 @@
class="player" class="player"
v-if=" v-if="
(role.id == 'dawn' || role.team == 'fabled') && (role.id == 'dawn' || role.team == 'fabled') &&
!session.isSpectator && !session.isSpectator &&
players.length && players[0].role.id players.length &&
players[0].role.id
" "
> >
<br /> <br />
@ -109,8 +110,9 @@
(role.id == 'dawn' || (role.id == 'dawn' ||
role.id == 'dusk' || role.id == 'dusk' ||
role.team == 'fabled') && role.team == 'fabled') &&
!session.isSpectator && !session.isSpectator &&
players.length && players[0].role.id players.length &&
players[0].role.id
" "
> >
<br /> <br />
@ -144,19 +146,19 @@ export default {
firstNight: 60, firstNight: 60,
team: "default", team: "default",
players: [], players: [],
firstNightReminder: this.locale.modal.nightOrder.dawnDescription1 firstNightReminder: this.locale.modal.nightOrder.dawnDescription1,
}); });
var toymaker = false; var toymaker = false;
// Ajout des fabuleux // Ajout des fabuleux
this.fabled.forEach(fabled => { this.fabled.forEach((fabled) => {
if (fabled.firstNight) { if (fabled.firstNight) {
rolesFirstNight.push(Object.assign({ players: [] }, fabled)); rolesFirstNight.push(Object.assign({ players: [] }, fabled));
} else if (fabled.id == "toymaker") { } else if (fabled.id == "toymaker") {
toymaker = true; toymaker = true;
} }
}); });
this.roles.forEach(role => { this.roles.forEach((role) => {
const players = this.players.filter(p => p.role.id === role.id); const players = this.players.filter((p) => p.role.id === role.id);
if (role.firstNight && role.team !== "traveler") { if (role.firstNight && role.team !== "traveler") {
rolesFirstNight.push(Object.assign({ players }, role)); rolesFirstNight.push(Object.assign({ players }, role));
} }
@ -164,14 +166,14 @@ export default {
// Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double // Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double
const seenTravelers = []; const seenTravelers = [];
var nbTravelers = 0; var nbTravelers = 0;
this.players.forEach(player => { this.players.forEach((player) => {
if (player.role.team == "traveler") { if (player.role.team == "traveler") {
nbTravelers++; nbTravelers++;
if (!seenTravelers.includes(player.role.id)) { if (!seenTravelers.includes(player.role.id)) {
seenTravelers.push(player.role.id); seenTravelers.push(player.role.id);
if (player.role.firstNight) { if (player.role.firstNight) {
const players = this.players.filter( const players = this.players.filter(
p => p.role.id === player.role.id (p) => p.role.id === player.role.id,
); );
rolesFirstNight.push(Object.assign({ players }, player.role)); rolesFirstNight.push(Object.assign({ players }, player.role));
} }
@ -213,7 +215,7 @@ export default {
team: "default", team: "default",
otherNight: 1, otherNight: 1,
players: [], players: [],
otherNightReminder: this.locale.modal.nightOrder.duskDescription otherNightReminder: this.locale.modal.nightOrder.duskDescription,
}, },
{ {
id: "dawn", id: "dawn",
@ -221,31 +223,30 @@ export default {
team: "default", team: "default",
otherNight: Infinity, otherNight: Infinity,
players: [], players: [],
otherNightReminder: this.locale.modal.nightOrder.dawnDescription2 otherNightReminder: this.locale.modal.nightOrder.dawnDescription2,
},
}
); );
this.fabled this.fabled
.filter(({ otherNight }) => otherNight) .filter(({ otherNight }) => otherNight)
.forEach((fabled) => { .forEach((fabled) => {
rolesOtherNight.push(Object.assign({ players: [] }, fabled)); rolesOtherNight.push(Object.assign({ players: [] }, fabled));
}); });
this.roles.forEach(role => { this.roles.forEach((role) => {
const players = this.players.filter(p => p.role.id === role.id); const players = this.players.filter((p) => p.role.id === role.id);
if (role.otherNight && role.team !== "traveler") { if (role.otherNight && role.team !== "traveler") {
rolesOtherNight.push(Object.assign({ players }, role)); rolesOtherNight.push(Object.assign({ players }, role));
} }
}); });
// Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double // Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double
const seenTravelers = []; const seenTravelers = [];
this.players.forEach(player => { this.players.forEach((player) => {
if ( if (
player.role.otherNight && player.role.otherNight &&
player.role.team == "traveler" && player.role.team == "traveler" &&
!seenTravelers.includes(player.role.id) !seenTravelers.includes(player.role.id)
) { ) {
const players = this.players.filter( const players = this.players.filter(
p => p.role.id === player.role.id (p) => p.role.id === player.role.id,
); );
seenTravelers.push(player.role.id); seenTravelers.push(player.role.id);
rolesOtherNight.push(Object.assign({ players }, player.role)); rolesOtherNight.push(Object.assign({ players }, player.role));
@ -260,9 +261,9 @@ export default {
"edition", "edition",
"grimoire", "grimoire",
"locale", "locale",
"session" "session",
]), ]),
...mapState("players", ["players", "fabled"]) ...mapState("players", ["players", "fabled"]),
}, },
methods: { methods: {
...mapMutations(["toggleModal"]), ...mapMutations(["toggleModal"]),

View file

@ -68,8 +68,8 @@
vote.votes == null vote.votes == null
? 'minus-square' ? 'minus-square'
: vote.votes.length >= vote.majority : vote.votes.length >= vote.majority
? 'check-square' ? 'check-square'
: 'square', : 'square',
]" ]"
/> />
</td> </td>