fixed visual bug with start game on click max-btn

This commit is contained in:
Kostya
2024-01-27 23:28:58 +03:00
parent b97bce1dc6
commit 96bea8824c
2 changed files with 15 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ export default {
.then(response => { .then(response => {
this.balance = response.currentMoney this.balance = response.currentMoney
}) })
eventBus.emit('Updatebalance-saper')
} }
}, },
data() { data() {

View File

@@ -373,6 +373,14 @@ export default {
} }
} }
}, },
mounted() {
eventBus.on('Updatebalance-saper', () => {
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
.then(response => {
this.balance = response
})
})
},
methods: { methods: {
clickPlayButton() { clickPlayButton() {
this.v$.$touch() this.v$.$touch()
@@ -472,7 +480,12 @@ export default {
if (content === 'max') { if (content === 'max') {
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken')) await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
.then((response) => { .then((response) => {
this.amountDeposit = parseInt(response.currentMoney) console.log(response.currentMoney, this.balance)
const responseBalance = response.currentMoney
if (responseBalance === this.balance) {
this.amountDeposit = parseInt(responseBalance)
}
}) })
} }
else { else {