feat(individual parts): lock the submit button when processing
This commit is contained in:
parent
c546ebdb83
commit
d124065af2
1 changed files with 7 additions and 1 deletions
|
@ -91,13 +91,19 @@ const main = (): void => {
|
|||
submitBtn.value = 'Download PDF'
|
||||
fieldset.append(submitBtn)
|
||||
|
||||
submitBtn.onclick = async (): Promise<void> => {
|
||||
const onSubmit = async (): Promise<void> => {
|
||||
// lock the button when processing
|
||||
submitBtn.onclick = null
|
||||
|
||||
const checked = fieldset.querySelector('input:checked') as HTMLInputElement
|
||||
const partName = checked.alt
|
||||
|
||||
const data = new Blob([await score.savePdf()])
|
||||
saveAs(data, `${filename} - ${partName}.pdf`)
|
||||
|
||||
submitBtn.onclick = onSubmit
|
||||
}
|
||||
submitBtn.onclick = onSubmit
|
||||
}),
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue