mirror of
https://github.com/originalmk/skrytka-app.git
synced 2025-01-18 16:29:17 +00:00
Added limit of scores stored in the user's session (hardcoded 10)
This commit is contained in:
parent
13826f7360
commit
764af4a93c
4
app.js
4
app.js
@ -535,6 +535,10 @@ app.post('/quiz-results', async (req, res) => {
|
|||||||
req.session.quizResults = [];
|
req.session.quizResults = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(req.session.quizResults.length == 10) {
|
||||||
|
req.session.quizResults.shift();
|
||||||
|
}
|
||||||
|
|
||||||
req.session.quizResults.push({ fireTruckID: fireTruck, seconds, points });
|
req.session.quizResults.push({ fireTruckID: fireTruck, seconds, points });
|
||||||
} else {
|
} else {
|
||||||
// Zapis na konto
|
// Zapis na konto
|
||||||
|
Loading…
x
Reference in New Issue
Block a user