fix bug in jackpot

This commit is contained in:
Hepatica
2024-02-25 05:15:38 +01:00
parent a8708cf50e
commit 71264d32e2

View File

@@ -438,37 +438,37 @@ export default {
this.offBtn = false; this.offBtn = false;
this.errorPlayButton(); this.errorPlayButton();
} }
const userData = { const userData = {
searchToken: GetCookie("SearchToken"), searchToken: GetCookie("SearchToken"),
authtoken: GetCookie("AUTHTOKEN"), authtoken: GetCookie("AUTHTOKEN"),
}; };
await JoinJackpotGame(userData, this.amountDeposit).then((response) => { await JoinJackpotGame(userData, this.amountDeposit).then((response) => {
console.log(this.balance); console.log(this.balance);
console.log(response); console.log(response);
if ( if (
response === `You can't join to started or ended game` || response === `You can't join to started or ended game` ||
response === "Player alredy in the game." response === "Player alredy in the game."
) { ) {
this.offBtn = false; this.offBtn = false;
if (response === `You can't join to started or ended game`) { if (response === `You can't join to started or ended game`) {
this.textError = "Игра уже началась или только закончилась!"; this.textError = "Игра уже началась или только закончилась!";
this.errorPlayButton(); this.errorPlayButton();
} else if (response === "Player alredy in the game.") { } else if (response === "Player alredy in the game.") {
this.textError = "Вы уже в игре!"; this.textError = "Вы уже в игре!";
this.errorPlayButton(); this.errorPlayButton();
}
return;
} }
if (response.ok) { return;
this.offBtn = false; }
this.startGame = true;
} if (response.ok) {
}); this.offBtn = false;
this.offBtn = false; this.startGame = true;
}
});
this.offBtn = false;
}, },
updatePlayerInfo(newName, newGems, newChance) { updatePlayerInfo(newName, newGems, newChance) {
this.player.name = newName; this.player.name = newName;
@@ -491,7 +491,7 @@ export default {
}); });
players.forEach((player) => { players.forEach((player) => {
const numberOfCards = player.WinningPercentage / 10; // Предполагаем, что 10% это 1 карточка const numberOfCards = player.WinningPercentage; // Предполагаем, что 10% это 1 карточка
// const numberOfCards = player.WinningPercentage / 10; // Предполагаем, что 10% это 1 карточка // const numberOfCards = player.WinningPercentage / 10; // Предполагаем, что 10% это 1 карточка
for (let i = 0; i < numberOfCards; i++) { for (let i = 0; i < numberOfCards; i++) {
if (i == 0) { if (i == 0) {
@@ -687,12 +687,12 @@ export default {
if (dataObject.CurrentGame.GameState == "StartGameTimer") { if (dataObject.CurrentGame.GameState == "StartGameTimer") {
if (!this.isGameTimerStarted) { if (!this.isGameTimerStarted) {
console.log("Set players"); console.log("Set players");
this.mapPlayersToSlides(
dataObject.CurrentGame.PlayerList,
dataObject.CurrentGame.PlayerList
);
this.idCurrentGame = dataObject.CurrentGame.Id; this.idCurrentGame = dataObject.CurrentGame.Id;
} }
this.mapPlayersToSlides(
dataObject.CurrentGame.PlayerList,
dataObject.CurrentGame.PlayerList
);
this.startGameTimer(dataObject.CurrentGame.StartGameUtc); this.startGameTimer(dataObject.CurrentGame.StartGameUtc);
} }