File tree Expand file tree Collapse file tree
pages/broadcast/[broadcastId] Expand file tree Collapse file tree Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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 ] )
You can’t perform that action at this time.
0 commit comments