Fixed drawing winner count was +1.
On /lottery frontend page the count of winners that is sent to frontend over socketIO started one index higher than it should. This was from updating how winners are saved in the backend. Our winners array now no longer needs to be incremented with 1 from the backend.
This commit is contained in:
@@ -9,7 +9,7 @@ const drawWinner = (req, res) => {
|
||||
io.emit("winner", {
|
||||
color: color,
|
||||
name: winner.name,
|
||||
winner_count: winners.length + 1
|
||||
winner_count: winners.length
|
||||
});
|
||||
|
||||
return { winner, color, winners };
|
||||
|
||||
@@ -146,7 +146,6 @@ export default {
|
||||
var timeLeft = animationEnd - Date.now();
|
||||
if (timeLeft <= 0) {
|
||||
self.drawing = false;
|
||||
console.time("drawing finished");
|
||||
return clearInterval(interval);
|
||||
}
|
||||
if (currentName == "Amund Brandsrud") {
|
||||
|
||||
Reference in New Issue
Block a user