fix type
All checks were successful
Deploy / deploy (push) Successful in 5m42s

This commit is contained in:
Lee 2024-09-30 14:15:23 +01:00
parent 342dbefac7
commit 639e7f16ec
2 changed files with 7 additions and 9 deletions

@ -1,21 +1,16 @@
export interface PlayerHistory { export interface PlayerHistory {
/**
* An object with the player's statistics
*/
[key: string]: number | null;
/** /**
* The player's rank. * The player's rank.
*/ */
rank: number; rank?: number;
/** /**
* The player's country rank. * The player's country rank.
*/ */
countryRank: number; countryRank?: number;
/** /**
* The pp of the player. * The pp of the player.
*/ */
pp: number; pp?: number;
} }

@ -229,8 +229,11 @@ export default function PlayerRankChart({ player }: Props) {
const daysAgo = getDaysAgo(currentDate); const daysAgo = getDaysAgo(currentDate);
labels.push(daysAgo === 0 ? "Today" : `${daysAgo} days ago`); 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) => { 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; previousDate = currentDate;