added vision old-bid if exit from page crash

This commit is contained in:
Kostya
2024-02-04 22:10:30 +03:00
parent 3be3fd6104
commit 8478e23be4

View File

@@ -108,12 +108,13 @@ export default {
const dataCrashParse = JSON.parse(dataCrash) const dataCrashParse = JSON.parse(dataCrash)
this.crashObject = dataCrashParse this.crashObject = dataCrashParse
console.log(this.crashObject) // console.log(this.crashObject)
} }
catch (e) { catch (e) {
console.error(e) console.error(e)
} }
if (this.crashObject.Status === 'GameEnd' && this.crashObject.Players.some(player => player.UserName === GetCookie('SpUserName'))) {
if (this.crashObject.Status === 'GameEnd' && this.startGame === true && this.crashObject.Players.some(player => player.UserName === GetCookie('SpUserName'))) {
this.startGame = false this.startGame = false
} }
if ( if (
@@ -123,6 +124,13 @@ export default {
this.crashObject.Players.some(player => player.UserGameState !== 'Win') this.crashObject.Players.some(player => player.UserGameState !== 'Win')
) { ) {
this.startGame = true; this.startGame = true;
let User = this.crashObject.Players.find(player => player.UserName === GetCookie('SpUserName'))
console.log(User)
if (User) {
this.amountDeposit = User.Bid
User = null
}
} }
}) })
}, },