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() {
|
async function shareQuiz() {
|
||||||
|
|
||||||
if (state.id) {
|
if (state.id) {
|
||||||
@ -222,13 +233,14 @@ function createQuiz() {
|
|||||||
|
|
||||||
console.log('Creating new quiz')
|
console.log('Creating new quiz')
|
||||||
|
|
||||||
|
state = defaultState
|
||||||
|
removeLink()
|
||||||
|
|
||||||
if (parseSpreadsheet().success == false)
|
if (parseSpreadsheet().success == false)
|
||||||
return
|
return
|
||||||
|
|
||||||
console.log('Spreadsheet parsing successful')
|
console.log('Spreadsheet parsing successful')
|
||||||
|
|
||||||
state.timer = 0
|
|
||||||
|
|
||||||
state.title = document.getElementById('titleField').value
|
state.title = document.getElementById('titleField').value
|
||||||
updateTitles()
|
updateTitles()
|
||||||
|
|
||||||
@ -251,8 +263,6 @@ function endQuiz() {
|
|||||||
if (state.interval)
|
if (state.interval)
|
||||||
clearInterval(state.interval)
|
clearInterval(state.interval)
|
||||||
|
|
||||||
state = defaultState
|
|
||||||
|
|
||||||
console.log('Quiz ended')
|
console.log('Quiz ended')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user