fix a bug where it would clear the scores db
All checks were successful
deploy / deploy (push) Successful in 56s

This commit is contained in:
Lee 2023-10-23 16:30:53 +01:00
parent cc1b6d9a63
commit abaf378511

View File

@ -133,13 +133,10 @@ export const useScoresaberScoresStore = create<ScoreSaberScoresStore>()(
}
if (mostRecentScoreId) {
// remove the old score
const oldScoreIndex = oldScores.findIndex(
(score) => score.score.id == score.score.id,
// remove the score if it already exists
oldScores = oldScores.filter(
(oldScore) => oldScore.score.id != score.score.id,
);
if (oldScoreIndex != -1) {
oldScores = oldScores.splice(oldScoreIndex, 1);
}
}
oldScores.push({
score: {