Skip to content

Commit af4ba58

Browse files
committed
Apply filename change to download of individual submissions too
1 parent 15fce4c commit af4ba58

File tree

1 file changed

+6
-1
lines changed
  • src/components/ChallengeEditor/Submissions

1 file changed

+6
-1
lines changed

src/components/ChallengeEditor/Submissions/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,12 @@ class SubmissionsComponent extends React.Component {
515515
const url = window.URL.createObjectURL(new Blob([blob]))
516516
const link = document.createElement('a')
517517
link.href = url
518-
link.setAttribute('download', `${s.legacySubmissionId}.zip`)
518+
let fileName = s.legacySubmissionId
519+
if (!fileName) {
520+
fileName = s.id
521+
}
522+
fileName = fileName + '.zip'
523+
link.setAttribute('download', `${fileName}`)
519524
document.body.appendChild(link)
520525
link.click()
521526
link.parentNode.removeChild(link)

0 commit comments

Comments
 (0)