fix a bug where it would clear the scores db
All checks were successful
deploy / deploy (push) Successful in 56s
All checks were successful
deploy / deploy (push) Successful in 56s
This commit is contained in:
parent
cc1b6d9a63
commit
abaf378511
@ -133,13 +133,10 @@ export const useScoresaberScoresStore = create<ScoreSaberScoresStore>()(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mostRecentScoreId) {
|
if (mostRecentScoreId) {
|
||||||
// remove the old score
|
// remove the score if it already exists
|
||||||
const oldScoreIndex = oldScores.findIndex(
|
oldScores = oldScores.filter(
|
||||||
(score) => score.score.id == score.score.id,
|
(oldScore) => oldScore.score.id != score.score.id,
|
||||||
);
|
);
|
||||||
if (oldScoreIndex != -1) {
|
|
||||||
oldScores = oldScores.splice(oldScoreIndex, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
oldScores.push({
|
oldScores.push({
|
||||||
score: {
|
score: {
|
||||||
|
Loading…
Reference in New Issue
Block a user