fixed bug with saper

This commit is contained in:
Kostya
2024-02-11 23:18:45 +03:00
parent f1f547259c
commit f489b80de8

View File

@@ -284,44 +284,46 @@ export default {
} }
}, },
async amountCrystals(CrystalsCount) { async amountCrystals(CrystalsCount) {
this.PercentageGameSteps = [] setTimeout(async () => {
if (![1, 5, 10, 24].includes(CrystalsCount)) { this.PercentageGameSteps = []
this.clickedBtnCrystal = null if (![1, 5, 10, 24].includes(CrystalsCount)) {
} this.clickedBtnCrystal = null
else { }
let index else {
switch (CrystalsCount) { let index
case 1: switch (CrystalsCount) {
index = 0 case 1:
break index = 0
case 5: break
index = 1 case 5:
break index = 1
case 10: break
index = 2 case 10:
break index = 2
case 24: break
index = 3 case 24:
break index = 3
break
}
this.clickedBtnCrystals(index, CrystalsCount)
} }
this.clickedBtnCrystals(index, CrystalsCount)
}
if (CrystalsCount >= 1 && CrystalsCount <= 24) { if (CrystalsCount >= 1 && CrystalsCount <= 24) {
try { try {
await GetPercentageSteps(this.amountCrystals) await GetPercentageSteps(this.amountCrystals)
.then((response) => { .then((response) => {
response.forEach((item) => { response.forEach((item) => {
if (item !== 'Infinity' && item !== '-Infinity') { if (item !== 'Infinity' && item !== '-Infinity') {
this.PercentageGameSteps.push(Number(item)) this.PercentageGameSteps.push(Number(item))
} }
})
}) })
}) }
} catch (e) {
catch (e) {
console.error('Error in Percantage', e) console.error('Error in Percantage', e)
}
} }
} }, 200)
}, },
flippedCards: { flippedCards: {
async handler(value) { async handler(value) {