@@ -22,6 +22,8 @@ const modalDescription = ref('');
22
22
const min_bet = ref (1 )
23
23
const max_bet = ref (10 );
24
24
25
+ const loading = ref (false );
26
+
25
27
let lastTransactionId = null ;
26
28
27
29
const openModal = () => {
@@ -54,14 +56,15 @@ const viewTransaction = () => {
54
56
}
55
57
56
58
const incrementAmount = () => {
57
- if (amount .value + 0.1 <= max_bet) {
58
- amount .value += 0.1 ;
59
+ console .log (' increment' );
60
+ if (amount .value + 0.1 <= (max_bet .value )) {
61
+ amount .value = (amount .value + 0.1 )
59
62
}
60
63
}
61
64
62
65
const decrementAmount = () => {
63
- if (amount .value - 0.1 >= min_bet) {
64
- amount .value -= 0.1 ;
66
+ if (amount .value - 0.1 >= ( min_bet . value ) ) {
67
+ amount .value = ( amount . value - 0.1 )
65
68
}
66
69
}
67
70
@@ -73,9 +76,15 @@ onMounted(async () => {
73
76
min_bet .value = config .min_bet ;
74
77
max_bet .value = config .max_bet ;
75
78
76
- amount .value = config .min_bet ;
79
+ amount .value = parseFloat ( config .min_bet ) ;
77
80
78
81
currentBalance .value = await store .telegram .getWalletBalance ();
82
+
83
+ setInterval (async () => {
84
+ loading .value = true ;
85
+ currentBalance .value = await store .telegram .getWalletBalance ();
86
+ loading .value = false ;
87
+ }, 3000 );
79
88
});
80
89
< / script>
81
90
@@ -96,25 +105,27 @@ onMounted(async () => {
96
105
< div class = " flex justify-center" >
97
106
< div class = " relative flex items-center max-w-[8rem]" >
98
107
99
- < button type= " button" @click= " incrementAmount()" class = " bg-blue-800 0 border-blue-900 rounded-s-lg p-3 h-11 mr-1" >
108
+ < a @click= " decrementAmount()"
109
+ class = " bg-blue-800 0 border-blue-900 rounded-s-lg p-3 h-11 mr-1" >
100
110
< svg class = " w-3 h-3 text-white dark:text-white" aria- hidden= " true" xmlns= " http://www.w3.org/2000/svg"
101
111
fill= " none" viewBox= " 0 0 18 2" >
102
112
< path stroke= " currentColor" stroke- linecap= " round" stroke- linejoin= " round" stroke- width= " 2"
103
113
d= " M1 1h16" / >
104
114
< / svg>
105
- < / button >
115
+ < / a >
106
116
107
117
< input type= " number" v- model= " amount" data- input- counter aria- describedby= " helper-text-explanation"
108
118
class = " bg-blue-50 border-x-0 h-11 focus:border-none text-center text-gray-900 font-bold text-sm block w-full py-2.5"
109
119
placeholder= " 1" required / >
110
120
111
- < button type= " button" @click= " decrementAmount()" class = " bg-blue-800 0 border-blue-900 rounded-e-lg p-3 h-11 ml-1" >
121
+ < a @click= " incrementAmount()"
122
+ class = " bg-blue-800 0 border-blue-900 rounded-e-lg p-3 h-11 ml-1" >
112
123
< svg class = " w-3 h-3 text-white dark:text-white" aria- hidden= " true" xmlns= " http://www.w3.org/2000/svg"
113
124
fill= " none" viewBox= " 0 0 18 18" >
114
125
< path stroke= " currentColor" stroke- linecap= " round" stroke- linejoin= " round" stroke- width= " 2"
115
126
d= " M9 1v16M1 9h16" / >
116
127
< / svg>
117
- < / button >
128
+ < / a >
118
129
119
130
< / div>
120
131
< / div>
@@ -132,7 +143,22 @@ onMounted(async () => {
132
143
133
144
< div v- if = " store.telegram.walletAccount" class = " mt-8 text-xs" >
134
145
< div class = " font-black uppercase text-[10px]" > Your balance< / div>
135
- < div class = " font-black text-lg" > {{ currentBalance }} TON < / div>
146
+ < div class = " font-black text-lg" >
147
+ < div class = " flex justify-center" >
148
+ < div>
149
+ {{ currentBalance }} TON
150
+ < / div>
151
+ < div class = " w-5" >
152
+ < svg v- if = " loading" class = " animate-spin ml-3 h-7 w-5 text-white" xmlns= " http://www.w3.org/2000/svg" fill= " none"
153
+ viewBox= " 0 0 24 24" >
154
+ < circle class = " opacity-25" cx= " 12" cy= " 12" r= " 10" stroke= " currentColor" stroke- width= " 4" >< / circle>
155
+ < path class = " opacity-75" fill= " currentColor"
156
+ d= " M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" >
157
+ < / path>
158
+ < / svg>
159
+ < / div>
160
+ < / div>
161
+ < / div>
136
162
< / div>
137
163
138
164
< div v- if = " !store.telegram.walletAccount" class = " mt-4 text-xs text-orange-500" >
0 commit comments