Skip to content

Commit cb49c9c

Browse files
fix: add move sounds for maia moves
1 parent efcca23 commit cb49c9c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/Core/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const Footer: React.FC = () => {
150150
</div>
151151
</div>
152152
<p className="text-left text-sm text-secondary md:text-center md:text-xs">
153-
© 2024 Maia Chess. All rights reserved.
153+
© 2025 Maia Chess. All rights reserved.
154154
</p>
155155
</div>
156156
)

src/pages/play/maia.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from 'src/api'
1212
import { ModalContext } from 'src/contexts'
1313
import { useStats } from 'src/hooks/useStats'
14+
import { useChessSound } from 'src/hooks/useChessSound'
1415
import { Color, TimeControl, PlayGameConfig } from 'src/types'
1516
import { usePlayController } from 'src/hooks/usePlayController'
1617
import { 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

Comments
 (0)