Skip to content

Commit 6ae40c1

Browse files
fix: build errors
1 parent 1a29ad5 commit 6ae40c1

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

src/api/analysis/analysis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ export const getAnalyzedTournamentGame = async (gameId = ['FkgYSri1']) => {
514514

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

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

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

528528
if (stockfishEval) {
529-
currentNode = currentNode.mainChild
529+
currentNode = currentNode.mainChild as GameNode
530530
if (currentNode) {
531531
currentNode.addStockfishAnalysis(stockfishEval)
532532
}

src/components/Analysis/LegacyAnalysisGameList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ interface LegacyAnalysisGameListProps {
1717
currentMaiaModel: string
1818
loadNewTournamentGame: (
1919
newId: string[],
20-
setCurrentMove: Dispatch<SetStateAction<number>>,
20+
setCurrentMove?: Dispatch<SetStateAction<number>>,
2121
) => Promise<void>
2222
loadNewLichessGames: (
2323
id: string,
2424
pgn: string,
25-
setCurrentMove: Dispatch<SetStateAction<number>>,
2625
currentMaiaModel: string,
26+
setCurrentMove?: Dispatch<SetStateAction<number>>,
2727
) => Promise<void>
2828
loadNewUserGames: (
2929
id: string,
3030
type: 'play' | 'hand' | 'brain',
31-
setCurrentMove: Dispatch<SetStateAction<number>>,
3231
currentMaiaModel: string,
32+
setCurrentMove?: Dispatch<SetStateAction<number>>,
3333
) => Promise<void>
3434
}
3535

src/components/Analysis/UserGameList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ interface Props {
1616
loadNewLichessGames: (
1717
id: string,
1818
pgn: string,
19-
setCurrentMove: Dispatch<SetStateAction<number>>,
2019
currentMaiaModel: string,
20+
setCurrentMove?: Dispatch<SetStateAction<number>>,
2121
) => void
2222
loadNewUserGames: (
2323
id: string,
2424
type: 'play' | 'hand' | 'brain',
25-
setCurrentMove: Dispatch<SetStateAction<number>>,
2625
currentMaiaModel: string,
26+
setCurrentMove?: Dispatch<SetStateAction<number>>,
2727
) => void
2828
currentMaiaModel: string
2929
}
@@ -89,15 +89,15 @@ export const UserGameList = ({
8989
await loadNewLichessGames(
9090
game.id,
9191
game.pgn as string,
92-
setCurrentIndex,
9392
currentMaiaModel,
93+
setCurrentIndex,
9494
)
9595
} else {
9696
await loadNewUserGames(
9797
game.id,
9898
game.type as 'play' | 'hand' | 'brain',
99-
setCurrentIndex,
10099
currentMaiaModel,
100+
setCurrentIndex,
101101
)
102102
}
103103
setLoadingIndex(null)

src/pages/analysis/[...id].tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,8 @@ const Analysis: React.FC<Props> = ({
583583
</select>
584584
</div>
585585
<ContinueAgainstMaia launchContinue={launchContinue} />
586-
<LegacyAnalysisGameList
586+
<AnalysisGameList
587587
currentId={currentId}
588-
currentMaiaModel={currentMaiaModel}
589588
loadNewTournamentGame={getAndSetTournamentGame}
590589
loadNewLichessGames={getAndSetLichessGames}
591590
loadNewUserGames={getAndSetUserGames}

src/pages/analysis/legacy/[...id].tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const AnalysisPage: NextPage = () => {
9696
async (
9797
id: string,
9898
pgn: string,
99-
setCurrentMove?: Dispatch<SetStateAction<number>>,
10099
currentMaiaModel = 'maia_kdd_1500',
100+
setCurrentMove?: Dispatch<SetStateAction<number>>,
101101
) => {
102102
let game
103103
try {
@@ -121,8 +121,8 @@ const AnalysisPage: NextPage = () => {
121121
async (
122122
id: string,
123123
type: 'play' | 'hand' | 'brain',
124-
setCurrentMove?: Dispatch<SetStateAction<number>>,
125124
currentMaiaModel = 'maia_kdd_1500',
125+
setCurrentMove?: Dispatch<SetStateAction<number>>,
126126
) => {
127127
let game
128128
try {
@@ -192,14 +192,14 @@ interface Props {
192192
getAndSetLichessGames: (
193193
id: string,
194194
pgn: string,
195+
currentMaiaModel: string,
195196
setCurrentMove?: Dispatch<SetStateAction<number>>,
196-
currentMaiaModel?: string,
197197
) => Promise<void>
198198
getAndSetUserGames: (
199199
id: string,
200200
type: 'play' | 'hand' | 'brain',
201-
setCurrentMove: Dispatch<SetStateAction<number>>,
202201
currentMaiaModel: string,
202+
setCurrentMove?: Dispatch<SetStateAction<number>>,
203203
) => Promise<void>
204204
analyzedGame: LegacyAnalyzedGame
205205
initialIndex: number

0 commit comments

Comments
 (0)