Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Prevent download button from being clicked multiple times #433

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frontend/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ $(document).ready(function() {
});
$('#download-btn').click(download);
function download() {
// Disable the download button to avoid accidental double clicks.
$('#download-btn').attr('disabled', 'disabled');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can store this selector (#download-btn) in a var because it seems we try to retrieve this ID a few times
so something like this would be great :

const $downloadBtn = $('#download-btn');


storage.totalDownloads += 1;

const fileReceiver = new FileReceiver();
Expand Down