Skip to content

Commit 0335158

Browse files
committed
Fixed download button to download selection versions of file
1 parent 7712141 commit 0335158

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/src/components/files/FileActionsMenu.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ type FileActionsMenuProps = {
3838

3939
export const FileActionsMenu = (props: FileActionsMenuProps): JSX.Element => {
4040
const { fileId, datasetId, setSelectedVersion } = props;
41+
const selectedFileVersion = useSelector(
42+
(state: RootState) => state.file.selected_version_num
43+
);
4144

4245
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
4346
const [fileShareModalOpen, setFileShareModalOpen] = useState(false);
@@ -158,7 +161,7 @@ export const FileActionsMenu = (props: FileActionsMenuProps): JSX.Element => {
158161
type: INCREMENT_FILE_DOWNLOADS,
159162
receivedAt: Date.now(),
160163
});
161-
window.location.href = `${config.hostname}/api/v2/files/${fileId}`;
164+
window.location.href = `${config.hostname}/api/v2/files/${fileId}?version=${selectedFileVersion}`;
162165
}}
163166
endIcon={<Download />}
164167
>

0 commit comments

Comments
 (0)