switch to async storage for faster loading
All checks were successful
deploy / deploy (push) Successful in 1m55s

This commit is contained in:
Lee
2023-10-23 09:54:26 +01:00
parent 70ed248be7
commit a0aca8c9b1
10 changed files with 118 additions and 89 deletions

View File

@ -118,7 +118,7 @@ export function calcPpBoundary(playerId: string, expectedPp = 1) {
const rankedScores = useScoresaberScoresStore
.getState()
.players.find((p) => p.id === playerId)
?.scores?.scoresaber.filter((s) => s.score.pp !== undefined);
?.scores?.filter((s) => s.score.pp !== undefined);
if (!rankedScores) return null;
const rankedScorePps = rankedScores
@ -159,7 +159,7 @@ export function getHighestPpPlay(playerId: string) {
const rankedScores = useScoresaberScoresStore
.getState()
.players.find((p) => p.id === playerId)
?.scores?.scoresaber.filter((s) => s.score.pp !== undefined);
?.scores?.filter((s) => s.score.pp !== undefined);
if (!rankedScores) return null;
const rankedScorePps = rankedScores
@ -179,7 +179,7 @@ export function getAveragePp(playerId: string, limit: number = 20) {
const rankedScores = useScoresaberScoresStore
.getState()
.players.find((p) => p.id === playerId)
?.scores?.scoresaber.filter((s) => s.score.pp !== undefined);
?.scores?.filter((s) => s.score.pp !== undefined);
if (!rankedScores) return null;
const rankedScorePps = rankedScores