diff --git a/src/utils/lichess/api.tsx b/src/utils/lichess/api.tsx index da0c8cc0..cd0e4a71 100644 --- a/src/utils/lichess/api.tsx +++ b/src/utils/lichess/api.tsx @@ -165,7 +165,7 @@ type PositionGames = { export async function convertToNormalized( data: PositionGames, ): Promise { - return await Promise.all( + const results = await Promise.allSettled( data.map(async (game, i) => { const pgn = await getLichessGame(game.id); const { headers, root } = await parsePGN(pgn); @@ -183,6 +183,9 @@ export async function convertToNormalized( return normalized; }), ); + return results + .filter((r) => r.status === "fulfilled") + .map((r) => (r as PromiseFulfilledResult).value); } type PositionData = {