@@ -11,10 +11,8 @@ import { StonesABI, ZeroAddress, arrayFrom } from '@betfinio/abi';
11
11
import { BetValue } from '@betfinio/components/shared' ;
12
12
import { Bet } from '@betfinio/ui' ;
13
13
import { useQueryClient } from '@tanstack/react-query' ;
14
- import { cx } from 'class-variance-authority' ;
15
14
import { AnimatePresence , motion , useAnimation } from 'framer-motion' ;
16
15
import { useEffect , useRef , useState } from 'react' ;
17
- import { useTranslation } from 'react-i18next' ;
18
16
import { useAccount , useWatchContractEvent } from 'wagmi' ;
19
17
import arrowdown from '../../assets/Roulette/arrow-down.svg' ;
20
18
import neonImage from '../../assets/Roulette/neon-glow.png' ;
@@ -100,11 +98,11 @@ const Wheel = () => {
100
98
const { data : status = 0 } = useRoundStatus ( currentRound ) ;
101
99
const [ _ , end ] = getRoundTimes ( currentRound ) ;
102
100
useEffect ( ( ) => {
103
- if ( status > 0 || end < Date . now ( ) / 1000 || actualRound !== currentRound ) {
101
+ if ( status > 0 || end < Date . now ( ) / 1000 ) {
104
102
setShowWinnerMessage ( true ) ;
105
103
setShowCountdown ( false ) ;
106
104
setSelectedStone ( winner || 1 ) ;
107
- } else {
105
+ } else if ( actualRound === currentRound ) {
108
106
setShowCountdown ( true ) ;
109
107
setShowWinnerMessage ( false ) ;
110
108
}
@@ -145,8 +143,8 @@ const Wheel = () => {
145
143
if ( bets . find ( ( bet ) => bet . side === side && bet . player === address ) ) {
146
144
shootConfetti ( ) ;
147
145
}
148
- await queryClient . invalidateQueries ( { queryKey : [ 'stones' , 'round' , round ] } ) ;
149
146
setShowWinnerMessage ( true ) ;
147
+ await queryClient . invalidateQueries ( { queryKey : [ 'stones' , 'round' , round ] } ) ;
150
148
} ) ;
151
149
} ,
152
150
} ) ;
@@ -220,8 +218,6 @@ const Wheel = () => {
220
218
} ;
221
219
} , [ ] ) ;
222
220
223
- const { t } = useTranslation ( 'stones' , { keyPrefix : 'roulette' } ) ;
224
-
225
221
return (
226
222
< div
227
223
key = { 'container' }
@@ -362,25 +358,6 @@ const Wheel = () => {
362
358
/>
363
359
</ motion . div >
364
360
{ showWinnerMessage && < WinnerInfo round = { currentRound } scale = { scale } /> }
365
- < div
366
- key = { 'round-over' }
367
- className = { cx ( 'flex flex-col' ) }
368
- style = { {
369
- fontSize : `${ 17 * scale * 2 } px` ,
370
- lineHeight : `${ 17 * scale * 2 } px` ,
371
- } }
372
- >
373
- < span > { t ( 'roundIsOver' ) } </ span >
374
- < span
375
- style = { {
376
- fontSize : `${ 10 * scale * 2 } px` ,
377
- lineHeight : `${ 14 * scale * 2 } px` ,
378
- } }
379
- className = { 'font-light text-tertiary-foreground' }
380
- >
381
- { t ( 'waitingForSpin' ) }
382
- </ span >
383
- </ div >
384
361
</ AnimatePresence >
385
362
</ div >
386
363
</ div >
0 commit comments