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:
2021-02-20 13:57:39 +01:00
parent 33fa7c14c6
commit b0424a519c
2 changed files with 1 additions and 2 deletions

View File

@@ -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 };

View File

@@ -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") {