Skip to content

Commit

Permalink
Fixed download button to download selection versions of file
Browse files Browse the repository at this point in the history
  • Loading branch information
Vismayak committed Jan 14, 2025
1 parent 7712141 commit 0335158
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/components/files/FileActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type FileActionsMenuProps = {

export const FileActionsMenu = (props: FileActionsMenuProps): JSX.Element => {
const { fileId, datasetId, setSelectedVersion } = props;
const selectedFileVersion = useSelector(
(state: RootState) => state.file.selected_version_num
);

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

0 comments on commit 0335158

Please sign in to comment.