fixed download button multi-click. fixes #927

This commit is contained in:
Danny Coates 2018-09-20 09:04:02 -07:00
parent 93e82cf953
commit fb83b324ab
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
1 changed files with 3 additions and 2 deletions

View File

@ -22,14 +22,15 @@ module.exports = function(state, emit) {
}
return html`
<button class="btn btn--download ${btnClass}"
<button class="btn btn--download ${btnClass}"
onclick=${download}>
${btnText}
</button>`;
function download(event) {
event.preventDefault();
if (downloadState !== 'complete') {
event.target.disabled = true;
if (downloadState === 'ready') {
emit('download', state.fileInfo);
}
}