Skip to content

Commit

Permalink
fix: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjosethomas committed Feb 8, 2025
1 parent 1a29ad5 commit 6ae40c1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/api/analysis/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export const getAnalyzedTournamentGame = async (gameId = ['FkgYSri1']) => {

const tree = buildGameTree(moves, moves[0].board)

let currentNode = tree.getRoot() as GameNode
let currentNode = tree.getRoot()
for (let i = 0; i < moves.length; i++) {
const move = moves[i]

Expand All @@ -526,7 +526,7 @@ export const getAnalyzedTournamentGame = async (gameId = ['FkgYSri1']) => {
: undefined

if (stockfishEval) {
currentNode = currentNode.mainChild
currentNode = currentNode.mainChild as GameNode
if (currentNode) {
currentNode.addStockfishAnalysis(stockfishEval)
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Analysis/LegacyAnalysisGameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ interface LegacyAnalysisGameListProps {
currentMaiaModel: string
loadNewTournamentGame: (
newId: string[],
setCurrentMove: Dispatch<SetStateAction<number>>,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => Promise<void>
loadNewLichessGames: (
id: string,
pgn: string,
setCurrentMove: Dispatch<SetStateAction<number>>,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => Promise<void>
loadNewUserGames: (
id: string,
type: 'play' | 'hand' | 'brain',
setCurrentMove: Dispatch<SetStateAction<number>>,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => Promise<void>
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/Analysis/UserGameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ interface Props {
loadNewLichessGames: (
id: string,
pgn: string,
setCurrentMove: Dispatch<SetStateAction<number>>,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => void
loadNewUserGames: (
id: string,
type: 'play' | 'hand' | 'brain',
setCurrentMove: Dispatch<SetStateAction<number>>,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => void
currentMaiaModel: string
}
Expand Down Expand Up @@ -89,15 +89,15 @@ export const UserGameList = ({
await loadNewLichessGames(
game.id,
game.pgn as string,
setCurrentIndex,
currentMaiaModel,
setCurrentIndex,
)
} else {
await loadNewUserGames(
game.id,
game.type as 'play' | 'hand' | 'brain',
setCurrentIndex,
currentMaiaModel,
setCurrentIndex,
)
}
setLoadingIndex(null)
Expand Down
3 changes: 1 addition & 2 deletions src/pages/analysis/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,8 @@ const Analysis: React.FC<Props> = ({
</select>
</div>
<ContinueAgainstMaia launchContinue={launchContinue} />
<LegacyAnalysisGameList
<AnalysisGameList
currentId={currentId}
currentMaiaModel={currentMaiaModel}
loadNewTournamentGame={getAndSetTournamentGame}
loadNewLichessGames={getAndSetLichessGames}
loadNewUserGames={getAndSetUserGames}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/analysis/legacy/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ const AnalysisPage: NextPage = () => {
async (
id: string,
pgn: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
currentMaiaModel = 'maia_kdd_1500',
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => {
let game
try {
Expand All @@ -121,8 +121,8 @@ const AnalysisPage: NextPage = () => {
async (
id: string,
type: 'play' | 'hand' | 'brain',
setCurrentMove?: Dispatch<SetStateAction<number>>,
currentMaiaModel = 'maia_kdd_1500',
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => {
let game
try {
Expand Down Expand Up @@ -192,14 +192,14 @@ interface Props {
getAndSetLichessGames: (
id: string,
pgn: string,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
currentMaiaModel?: string,
) => Promise<void>
getAndSetUserGames: (
id: string,
type: 'play' | 'hand' | 'brain',
setCurrentMove: Dispatch<SetStateAction<number>>,
currentMaiaModel: string,
setCurrentMove?: Dispatch<SetStateAction<number>>,
) => Promise<void>
analyzedGame: LegacyAnalyzedGame
initialIndex: number
Expand Down

0 comments on commit 6ae40c1

Please sign in to comment.