Skip to content

Commit

Permalink
refactor: address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Sep 8, 2022
1 parent 3ca26a5 commit 6541555
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/CDPUserDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const CDPUserDashboard = (props: Props): JSX.Element => {
// Negative sorts "reverse alphabetically" which allows newest files to appear first
.sort((a: CDPFile, b: CDPFile) => -a.key.localeCompare(b.key))

// wanted either filters out or only includes survey responses
const isSurveyResponse = (wanted: boolean) => (file: CDPFile) =>
file.key.includes('survey-response') === wanted
const surveyResponses = files.filter(isSurveyResponse(true))
Expand Down Expand Up @@ -184,7 +185,7 @@ const CDPUserDashboard = (props: Props): JSX.Element => {
(a: CDPFile, b: CDPFile) =>
// Sort by the number of slashes in the key name so that merged responses (not in subfolders)
// appear first.
(a.key.match(/\//g) || []).length >
(a.key.match(/\//g) || []).length -
(b.key.match(/\//g) || []).length
)}
setCurrentlyDownloadingFile={setCurrentlyDownloadingFile}
Expand Down

0 comments on commit 6541555

Please sign in to comment.