This commit is contained in:
parent
342dbefac7
commit
639e7f16ec
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user