fix(ssr): fix showing star count on unranked leaderboards
All checks were successful
deploy / deploy (push) Successful in 1m31s

This commit is contained in:
Lee 2023-11-09 18:57:25 +00:00
parent b60d713d3c
commit 0ffb3e341d
2 changed files with 16 additions and 5 deletions

@ -115,11 +115,13 @@ export default function Leaderboard({ id, page }: LeaderboardProps) {
</div> </div>
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
<p>Status: {ranked ? "Ranked" : "Unranked"}</p> <p>Status: {ranked ? "Ranked" : "Unranked"}</p>
<div className="flex"> {ranked && (
<p>Stars:</p> <div className="flex">
<StarIcon width={20} height={20} className="ml-1" /> <p>Stars:</p>
<p className="text-pp-blue">{stars}</p> <StarIcon width={20} height={20} className="ml-1" />
</div> <p className="text-pp-blue">{stars}</p>
</div>
)}
<p> <p>
Plays: {formatNumber(plays)} ({dailyPlays} in the last day) Plays: {formatNumber(plays)} ({dailyPlays} in the last day)
</p> </p>

@ -125,6 +125,15 @@ async function fetchScores(
}; };
} }
/**
* Gets the players scores with beatsaver data from the given page
*
* @param playerId the id of the player
* @param page the page to get the scores from
* @param searchType the type of search to perform
* @param limit the limit of scores to get
* @returns the scores with beatsaver data
*/
async function fetchScoresWithBeatsaverData( async function fetchScoresWithBeatsaverData(
playerId: string, playerId: string,
page: number = 1, page: number = 1,