From 05e257f8bef001e1cdd311eb09d3817e32c99200 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 23 Oct 2023 10:36:48 +0100 Subject: [PATCH] cleanup and added total scores label --- src/components/player/PlayerInfo.tsx | 9 +- src/store/scoresaberScoresStore.ts | 246 +++++++++++---------------- src/utils/scoresaber/scores.ts | 10 ++ 3 files changed, 118 insertions(+), 147 deletions(-) diff --git a/src/components/player/PlayerInfo.tsx b/src/components/player/PlayerInfo.tsx index 88bc9c1..c492fee 100644 --- a/src/components/player/PlayerInfo.tsx +++ b/src/components/player/PlayerInfo.tsx @@ -6,6 +6,7 @@ import { calcPpBoundary, getAveragePp, getHighestPpPlay, + getTotalScores, } from "@/utils/scoresaber/scores"; import { GlobeAsiaAustraliaIcon, @@ -53,7 +54,7 @@ export default function PlayerInfo({ playerData }: PlayerInfoProps) { async function addProfile(isFriend: boolean) { if (!useScoresaberScoresStore.getState().exists(playerId)) { - const reponse = await playerScoreStore?.addPlayer( + const reponse = await playerScoreStore?.addOrUpdatePlayer( playerId, (page, totalPages) => { const autoClose = page == totalPages ? 5000 : false; @@ -192,6 +193,12 @@ export default function PlayerInfo({ playerData }: PlayerInfoProps) { {hasLocalScores && ( <> +