diff --git a/src/common/player/player-history.ts b/src/common/player/player-history.ts index 6c50af0..1f7dd81 100644 --- a/src/common/player/player-history.ts +++ b/src/common/player/player-history.ts @@ -1,21 +1,16 @@ export interface PlayerHistory { - /** - * An object with the player's statistics - */ - [key: string]: number | null; - /** * The player's rank. */ - rank: number; + rank?: number; /** * The player's country rank. */ - countryRank: number; + countryRank?: number; /** * The pp of the player. */ - pp: number; + pp?: number; } diff --git a/src/components/player/player-rank-chart.tsx b/src/components/player/player-rank-chart.tsx index c6fd691..0155d11 100644 --- a/src/components/player/player-rank-chart.tsx +++ b/src/components/player/player-rank-chart.tsx @@ -229,8 +229,11 @@ export default function PlayerRankChart({ player }: Props) { const daysAgo = getDaysAgo(currentDate); labels.push(daysAgo === 0 ? "Today" : `${daysAgo} days ago`); + // stupid typescript crying wahh wahh wahh - https://youtu.be/hBEKgHDzm_s?si=ekOdMMdb-lFnA1Yz&t=11 datasetConfig.forEach((config) => { - histories[config.field].push(history[config.field] ?? null); + (histories as any)[config.field].push( + (history as any)[config.field] ?? null, + ); }); previousDate = currentDate;