fix : lichess api return type
This commit is contained in:
@@ -160,7 +160,9 @@ export default function EngineSettingsDialog({ open, onClose }: Props) {
|
|||||||
displayEmpty
|
displayEmpty
|
||||||
input={<OutlinedInput label="Piece set" />}
|
input={<OutlinedInput label="Piece set" />}
|
||||||
value={pieceSet}
|
value={pieceSet}
|
||||||
onChange={(e) => setPieceSet(e.target.value)}
|
onChange={(e) =>
|
||||||
|
setPieceSet(e.target.value as (typeof PIECE_SETS)[number])
|
||||||
|
}
|
||||||
sx={{ width: 200, maxWidth: "100%" }}
|
sx={{ width: 200, maxWidth: "100%" }}
|
||||||
>
|
>
|
||||||
{PIECE_SETS.map((name) => (
|
{PIECE_SETS.map((name) => (
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default function LichessInput({ onSelect }: Props) {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setBoardOrientation(
|
setBoardOrientation(
|
||||||
lichessUsername.toLowerCase() !==
|
lichessUsername.toLowerCase() !==
|
||||||
game.players.black.user?.name.toLowerCase()
|
game.players?.black?.user?.name.toLowerCase()
|
||||||
);
|
);
|
||||||
onSelect(game.pgn);
|
onSelect(game.pgn);
|
||||||
}}
|
}}
|
||||||
@@ -81,10 +81,10 @@ export default function LichessInput({ onSelect }: Props) {
|
|||||||
>
|
>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={`${
|
primary={`${
|
||||||
capitalize(game.players.white.user?.name || "white") ||
|
capitalize(game.players?.white?.user?.name || "white") ||
|
||||||
"White"
|
"White"
|
||||||
} (${game.players?.white?.rating || "?"}) vs ${
|
} (${game.players?.white?.rating || "?"}) vs ${
|
||||||
capitalize(game.players.black.user?.name || "black") ||
|
capitalize(game.players?.black?.user?.name || "black") ||
|
||||||
"Black"
|
"Black"
|
||||||
} (${game.players?.black?.rating || "?"})`}
|
} (${game.players?.black?.rating || "?"})`}
|
||||||
secondary={`${capitalize(game.speed)} played at ${new Date(
|
secondary={`${capitalize(game.speed)} played at ${new Date(
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ export interface LichessGame {
|
|||||||
id: string;
|
id: string;
|
||||||
speed: string;
|
speed: string;
|
||||||
lastMoveAt: number;
|
lastMoveAt: number;
|
||||||
players: {
|
players?: {
|
||||||
white: LichessGameUser;
|
white?: LichessGameUser;
|
||||||
black: LichessGameUser;
|
black?: LichessGameUser;
|
||||||
};
|
};
|
||||||
pgn: string;
|
pgn: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user