Reset state after quiz

This commit is contained in:
2020-01-13 00:24:53 +01:00
committed by Oskar
parent fe519bf80a
commit 777be865f8

View File

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