Skip to content

Commit 6f05521

Browse files
futa-ikedaadlius
authored andcommitted
Remove unnecessary URL shenanigans
1 parent 48e7043 commit 6f05521

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

app/preprints/-components/preprint-file-render/component.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ export default class PreprintFileRender extends Component<InputArgs> {
5454

5555
private serializeVersions(versions: FileVersionModel[]) {
5656
const downloadUrl = this.primaryFile.links.download as string || '';
57-
const primaryFileGuid = this.primaryFile.id;
58-
59-
const directDownloadUrl = downloadUrl.replace(
60-
`download/${primaryFileGuid}`,
61-
`${primaryFileGuid}/download`,
62-
);
6357

6458
versions.map((version: VersionModel) => {
6559
const dateFormatted = encodeURIComponent(version.dateCreated.toISOString());
@@ -70,7 +64,7 @@ export default class PreprintFileRender extends Component<InputArgs> {
7064
name: version.name,
7165
id: version.id,
7266
dateCreated: version.dateCreated,
73-
downloadUrl: `${directDownloadUrl}?version=${version.id}&displayName=${displayName}`,
67+
downloadUrl: `${downloadUrl}?version=${version.id}&displayName=${displayName}`,
7468
} as VersionModel,
7569
);
7670
return version;

0 commit comments

Comments
 (0)