Skip to content

Commit

Permalink
fix(useCreateVote): reset hasBeenPlated flag
Browse files Browse the repository at this point in the history
  • Loading branch information
xiduzo committed Feb 4, 2024
1 parent 883ceab commit 0c3ea58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/expo/src/hooks/useCreateVote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export const useCreateVote = (pin: string) => {
tracks: prev.tracks.map((track) => {
if (track.trackId === trackId) {
track.score += vote - (previousVote?.vote ?? 0);
// Replaying a track just gives it a vote,
// Make sure to reset the hasBeenPlayed flag
track.hasBeenPlayed = false;
}
return track;
}),
Expand Down

0 comments on commit 0c3ea58

Please sign in to comment.