From 3acc4cd2fd5e3f2ba7ebed60d4a5dc0dfd69a3de Mon Sep 17 00:00:00 2001 From: Manuel Zedel Date: Fri, 4 Oct 2024 10:16:45 +0200 Subject: [PATCH] fix(gui): fixed an issue that could prevent downloading files from a device - was a regression of the recent RTK migration Ticket: None Changelog: None Signed-off-by: Manuel Zedel --- .../js/components/devices/device-details/connection.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/js/components/devices/device-details/connection.js b/frontend/src/js/components/devices/device-details/connection.js index be262397..19f6c014 100644 --- a/frontend/src/js/components/devices/device-details/connection.js +++ b/frontend/src/js/components/devices/device-details/connection.js @@ -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] );