Skip to content

Commit

Permalink
fix(incr/decr): open wallet connect if user click on increment/decrem…
Browse files Browse the repository at this point in the history
…ent without wallet connected
  • Loading branch information
thebatclaudio committed Sep 18, 2024
1 parent 8b39dd5 commit b6ff8b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,20 @@ const viewTransaction = () => {
}
const incrementAmount = () => {
if(!store.telegram.walletAccount) {
store.telegram.tonConnectUI.openModal();
}
if (amount.value + 0.1 <= (max_bet.value)) {
amount.value = parseFloat((amount.value + 0.1).toFixed(1))
}
}
const decrementAmount = () => {
if(!store.telegram.walletAccount) {
store.telegram.tonConnectUI.openModal();
}
if (amount.value - 0.1 >= (min_bet.value)) {
amount.value = parseFloat((amount.value - 0.1).toFixed(1))
}
Expand Down Expand Up @@ -98,7 +106,7 @@ onMounted(async () => {
<template>
<div class="text-center flex flex-col h-full">
<div class="flex-1">
<div class="text-center text-3xl uppercase p-5">
<div class="text-center text-3xl uppercase p-1">
<button id="ton-connect-button" type="button"></button>
</div>
<div class="flex flex-col justify-center content-center">
Expand All @@ -107,7 +115,7 @@ onMounted(async () => {
<div id="front" @click="playGame()"><img src="/icon.png" class="pulse h-[30vh]"></div>
</div>
</div>
<div class="mt-6">
<div class="mt-1">
<form class="max-w-xs mx-auto">
<label for="quantity-input" class="block mb-2 text-sm font-medium uppercase text-white">Your bet</label>
<div class="flex justify-center">
Expand Down

0 comments on commit b6ff8b3

Please sign in to comment.