only reset state on new quiz, then also remove link
This commit is contained in:
parent
295e851868
commit
e64f6ec709
18
src/main.js
18
src/main.js
|
@ -34,6 +34,17 @@ function showLink() {
|
|||
}
|
||||
|
||||
|
||||
function removeLink() {
|
||||
|
||||
var linkEl = document.getElementById('shareLink')
|
||||
linkEl.href = ''
|
||||
linkEl.innerHTML = ''
|
||||
|
||||
document.querySelector('#sharing input').style.display = 'block'
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function shareQuiz() {
|
||||
|
||||
if (state.id) {
|
||||
|
@ -222,13 +233,14 @@ function createQuiz() {
|
|||
|
||||
console.log('Creating new quiz')
|
||||
|
||||
state = defaultState
|
||||
removeLink()
|
||||
|
||||
if (parseSpreadsheet().success == false)
|
||||
return
|
||||
|
||||
console.log('Spreadsheet parsing successful')
|
||||
|
||||
state.timer = 0
|
||||
|
||||
state.title = document.getElementById('titleField').value
|
||||
updateTitles()
|
||||
|
||||
|
@ -251,8 +263,6 @@ function endQuiz() {
|
|||
if (state.interval)
|
||||
clearInterval(state.interval)
|
||||
|
||||
state = defaultState
|
||||
|
||||
console.log('Quiz ended')
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue