Skip to content

Commit a079ee4

Browse files
fix: restore broadcast analysis controls
1 parent b58d680 commit a079ee4

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/components/Analysis/BroadcastAnalysis.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ export const BroadcastAnalysis: React.FC<Props> = ({
12271227
<MovesByRating
12281228
moves={analysisController.movesByRating}
12291229
colorSanMapping={analysisController.colorSanMapping}
1230+
positionKey={analysisController.currentNode?.fen}
12301231
/>
12311232
</div>
12321233
</div>

src/pages/broadcast/[broadcastId]/[roundId].tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,21 @@ const BroadcastAnalysisPage: NextPage = () => {
115115
undefined,
116116
false,
117117
)
118+
const defaultModelAppliedForGameId = useRef<string | null>(null)
118119

119120
useEffect(() => {
120-
if (analysisController.currentMaiaModel !== 'maia_kdd_2600') {
121-
analysisController.setCurrentMaiaModel('maia_kdd_2600')
122-
}
121+
const gameId = broadcastController.currentGame?.id
122+
if (!gameId) return
123+
124+
if (defaultModelAppliedForGameId.current === gameId) return
125+
126+
defaultModelAppliedForGameId.current = gameId
127+
128+
if (analysisController.currentMaiaModel === 'maia_kdd_2600') return
129+
130+
analysisController.setCurrentMaiaModel('maia_kdd_2600')
123131
}, [
132+
broadcastController.currentGame?.id,
124133
analysisController.currentMaiaModel,
125134
analysisController.setCurrentMaiaModel,
126135
])

0 commit comments

Comments
 (0)