Reset state after quiz

This commit is contained in:
Oskar Winkels 2020-01-13 00:24:53 +01:00 committed by Oskar
parent fe519bf80a
commit 777be865f8
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
var state = {
const defaultState = {
style: 'FSCzech',
id: null,
title: null,
@ -8,6 +8,8 @@ var state = {
success: 0
}
var state = defaultState
function changeView(view) {
@ -249,6 +251,8 @@ function endQuiz() {
if (state.interval)
clearInterval(state.interval)
state = defaultState
console.log('Quiz ended')
}