Skip to content

Commit cad16a2

Browse files
committed
make stats update w/ turn playback
1 parent 608dd46 commit cad16a2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

client/src/components/sidebar/game/team-table.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { schema } from 'battlecode-schema'
55
import { TeamRoundStat } from '../../../playback/RoundStat'
66
import { DoubleChevronUpIcon } from '../../../icons/chevron'
77
import { CurrentMap } from '../../../playback/Map'
8-
import { useRound } from '../../../playback/GameRunner'
8+
import { useRound, useTurnNumber } from '../../../playback/GameRunner'
99

1010
interface UnitsIconProps {
1111
teamIdx: 0 | 1
@@ -34,6 +34,8 @@ interface TeamTableProps {
3434

3535
export const TeamTable: React.FC<TeamTableProps> = (props: TeamTableProps) => {
3636
const round = useRound()
37+
// force react to re-render when using turn playback
38+
const _turn = useTurnNumber()
3739
const teamStat = round?.stat?.getTeamStat(round?.match.game.teams[props.teamIdx])
3840
const map = round?.map
3941

0 commit comments

Comments
 (0)