Skip to content

Commit

Permalink
fix(incr/decr): struggling with javascript math issues (he need to st…
Browse files Browse the repository at this point in the history
…udy)
  • Loading branch information
thebatclaudio committed Sep 18, 2024
1 parent 7fc00b4 commit b012c05
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,28 @@ const viewTransaction = () => {
const incrementAmount = () => {
if(!store.telegram.walletAccount) {
store.telegram.tonConnectUI.openModal();
return;
}
if (amount.value + 0.1 <= (max_bet.value)) {
amount.value = parseFloat((amount.value + 0.1).toFixed(1))
const newAmountValue = parseFloat((amount.value + 0.1).toFixed(1));
if (newAmountValue <= (max_bet.value)) {
amount.value = newAmountValue;
}
}
const decrementAmount = () => {
if(!store.telegram.walletAccount) {
store.telegram.tonConnectUI.openModal();
return;
}
const newAmountValue = parseFloat((amount.value - 0.1).toFixed(1));
if (amount.value - 0.1 >= (min_bet.value)) {
amount.value = parseFloat((amount.value - 0.1).toFixed(1))
if (newAmountValue >= (min_bet.value)) {
amount.value = newAmountValue
}
}
Expand Down

0 comments on commit b012c05

Please sign in to comment.