fix migration
All checks were successful
deploy / deploy (push) Successful in 1m3s

This commit is contained in:
Lee 2023-10-22 08:52:14 +01:00
parent a8139676b8
commit b475ae1d66

View File

@ -232,11 +232,14 @@ export const usePlayerScoresStore = create<PlayerScoresStore>()(
migrate: (state: any, version: number) => {
if (version == 1) {
console.log("Migrating player scores...");
const players = state.players;
for (const player of players) {
player.scores = player.scores.scoresaber;
}
state.players = state.players.map((player: any) => {
return {
id: player.id,
scores: {
scoresaber: player.scores,
},
};
});
return state;
}