@@ -11,6 +11,7 @@ import {
1111} from 'src/api'
1212import { ModalContext } from 'src/contexts'
1313import { useStats } from 'src/hooks/useStats'
14+ import { useChessSound } from 'src/hooks/useChessSound'
1415import { Color , TimeControl , PlayGameConfig } from 'src/types'
1516import { usePlayController } from 'src/hooks/usePlayController'
1617import { Loading , PlayControls , GameplayInterface } from 'src/components'
@@ -29,6 +30,7 @@ const useVsMaiaPlayController = (
2930 id : string ,
3031 playGameConfig : PlayGameConfig ,
3132) => {
33+ const { playSound } = useChessSound ( )
3234 const controller = usePlayController ( id , playGameConfig )
3335
3436 const [ stats , incrementStats , updateRating ] = useStats ( playStatsLoader )
@@ -84,11 +86,13 @@ const useVsMaiaPlayController = (
8486 const moveTime = controller . updateClock ( )
8587 controller . setMoves ( [ ...controller . moves , nextMove ] )
8688 controller . setMoveTimes ( [ ...controller . moveTimes , moveTime ] )
89+ playSound ( false )
8790 } , moveDelay * 1000 )
8891 } else {
8992 const moveTime = controller . updateClock ( )
9093 controller . setMoves ( [ ...controller . moves , nextMove ] )
9194 controller . setMoveTimes ( [ ...controller . moveTimes , moveTime ] )
95+ playSound ( false )
9296 }
9397 }
9498 }
0 commit comments