From af4ba5849cd3a25222b0f1143ae28ca1a65d5a1b Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Thu, 1 Jun 2023 12:21:34 +1000 Subject: [PATCH] Apply filename change to download of individual submissions too --- src/components/ChallengeEditor/Submissions/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ChallengeEditor/Submissions/index.js b/src/components/ChallengeEditor/Submissions/index.js index 1a563f49..44f5f318 100644 --- a/src/components/ChallengeEditor/Submissions/index.js +++ b/src/components/ChallengeEditor/Submissions/index.js @@ -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)