Skip to content

Commit

Permalink
Add console log for empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Oct 29, 2023
1 parent 4bbcda7 commit 08eba71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/upload.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ imageUpload = (fileInput,endpoint='/screenshots/upload', classname="course") ->
# Temporary fix for ":type option required" error in the
# app/controllers/submissions_controller.rb -> show_correction
if data.metadata.size == 0
console.log('empty file encountered')
$(actualButton).hide()
$('#submit-correction-btn').addClass('disabled')
alert($(actualButton).data('tr-failure'))
Expand Down Expand Up @@ -310,6 +311,7 @@ bulkCorrectionUpload = (fileInput) ->
# Temporary fix for ":type option required" error in the
# app/controllers/submissions_controller.rb -> show_correction
if data.metadata.size == 0
console.log('empty file encountered during bulk upload')
alert($('#bulk-uploadButton-button-actual').data('tr-failure'))
$('#bulk-uploadButton-button-actual').hide()
return
Expand Down

0 comments on commit 08eba71

Please sign in to comment.