Skip to content

Commit

Permalink
fix(gui): fixed an issue that could prevent downloading files from a …
Browse files Browse the repository at this point in the history
…device

- was a regression of the recent RTK migration

Ticket: None
Changelog: None
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
  • Loading branch information
mzedel committed Oct 4, 2024
1 parent 1b87090 commit 3acc4cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/js/components/devices/device-details/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ export const DeviceConnection = ({ className = '', device }) => {
path => {
setDownloadPath(path);
dispatch(setSnackbar('Downloading file'));
dispatch(getDeviceFileDownloadLink({ deviceId: device.id, path })).then(address => {
const filename = path.substring(path.lastIndexOf('/') + 1) || 'file';
createDownload(address, filename, token);
});
dispatch(getDeviceFileDownloadLink({ deviceId: device.id, path }))
.unwrap()
.then(address => {
const filename = path.substring(path.lastIndexOf('/') + 1) || 'file';
createDownload(address, filename, token);
});
},
[dispatch, device.id, token]
);
Expand Down

0 comments on commit 3acc4cd

Please sign in to comment.