From a5f016bcbc27e98207b90a37a8166ca36ec6ae1d Mon Sep 17 00:00:00 2001 From: sumn2u Date: Wed, 26 Jun 2024 19:31:56 -0500 Subject: [PATCH] fix the space issue in urls and image names --- client/src/utils/send-data-to-server.js | 4 ++-- client/src/workspace/DownloadButton/index.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/utils/send-data-to-server.js b/client/src/utils/send-data-to-server.js index 71292ec..2bddfc0 100644 --- a/client/src/utils/send-data-to-server.js +++ b/client/src/utils/send-data-to-server.js @@ -3,8 +3,8 @@ import config from '../config.js' export const getImageData = (activeImage) => { let imageData = {} - imageData['src'] = activeImage.src - imageData['name'] = activeImage.name + imageData['src'] = decodeURIComponent(activeImage.src) + imageData['name'] = decodeURIComponent(activeImage.name) imageData['cls'] = activeImage.selectedClsList || [] imageData['comment'] = activeImage.comment || "" diff --git a/client/src/workspace/DownloadButton/index.jsx b/client/src/workspace/DownloadButton/index.jsx index 25a855d..d418ad4 100644 --- a/client/src/workspace/DownloadButton/index.jsx +++ b/client/src/workspace/DownloadButton/index.jsx @@ -17,7 +17,7 @@ import config from "../../config.js"; const DownloadButton = ({selectedImageName, classList, hideHeaderText, disabled, selectedImages}) => { const [anchorEl, setAnchorEl] = useState(null); const getImageNames = () => { - return selectedImages.map(image => image.src.split('/').pop()) + return selectedImages.map(image => decodeURIComponent(image.src.split('/').pop())) } const { showSnackbar } = useSnackbar(); const {t} = useTranslation();