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 7fc00b4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 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 Expand Up @@ -176,7 +184,7 @@ onMounted(async () => {
</div>
<div class="flex flex-col text-xs justify-center">
<p>Made with ♡ by <a href="https://t.me/gradoally" target="_blank" class="underline">Gradoally</a></p>
<p>Secured <a :href="contractLink" target="_blank" class="underline">on-chain</a></p>
<p class="mt-1">Secured <a :href="contractLink" target="_blank" class="underline">on-chain</a></p>
</div>
</div>
Expand Down

0 comments on commit 7fc00b4

Please sign in to comment.