Skip to content

Commit

Permalink
Apply filename change to download of individual submissions too
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Jun 1, 2023
1 parent 15fce4c commit af4ba58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ChallengeEditor/Submissions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,12 @@ class SubmissionsComponent extends React.Component {
const url = window.URL.createObjectURL(new Blob([blob]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', `${s.legacySubmissionId}.zip`)
let fileName = s.legacySubmissionId
if (!fileName) {
fileName = s.id
}
fileName = fileName + '.zip'
link.setAttribute('download', `${fileName}`)
document.body.appendChild(link)
link.click()
link.parentNode.removeChild(link)
Expand Down

0 comments on commit af4ba58

Please sign in to comment.