fix acc/pp being broken on new pages
Some checks failed
Deploy Website / deploy (push) Has been cancelled
Some checks failed
Deploy Website / deploy (push) Has been cancelled
This commit is contained in:
parent
20a0208e92
commit
1917a55725
@ -37,12 +37,18 @@ export default function Score({ player, playerScore }: Props) {
|
||||
setBeatSaverMap(beatSaverMapData);
|
||||
}, [leaderboard.songHash]);
|
||||
|
||||
useEffect(() => {
|
||||
if (playerScore?.score?.baseScore) {
|
||||
setBaseScore(playerScore.score.baseScore);
|
||||
}
|
||||
}, [playerScore]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchBeatSaverData();
|
||||
}, [fetchBeatSaverData]);
|
||||
|
||||
const accuracy = (baseScore / leaderboard.maxScore) * 100;
|
||||
const pp = scoresaberService.getPp(leaderboard.stars, accuracy);
|
||||
const pp = baseScore == score.baseScore ? score.pp : scoresaberService.getPp(leaderboard.stars, accuracy);
|
||||
return (
|
||||
<div className="pb-2 pt-2">
|
||||
{/* Score Info */}
|
||||
|
Reference in New Issue
Block a user