From 95582e71a0378e48ab46e889ae58ec17c77fe895 Mon Sep 17 00:00:00 2001 From: xrando <2837341L@student.gla.ac.uk> Date: Wed, 1 Nov 2023 12:24:38 +0800 Subject: [PATCH] added comments added comments --- .../safeshare-frontend/src/pages/downloadFile.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/safeshare/safeshare-frontend/src/pages/downloadFile.js b/safeshare/safeshare-frontend/src/pages/downloadFile.js index 641730f..12c6d79 100644 --- a/safeshare/safeshare-frontend/src/pages/downloadFile.js +++ b/safeshare/safeshare-frontend/src/pages/downloadFile.js @@ -13,7 +13,7 @@ const customStyles = { transform: 'translate(-50%, -50%)', }, }; - +// Download function function DownloadFile() { const [passcode, setPasscode] = useState(''); const [fileData, setFileData] = useState(null); @@ -23,24 +23,24 @@ function DownloadFile() { const apiUrl = process.env.REACT_APP_API_HOST || 'localhost:8000'; console.log(apiUrl); - + // Function to open modal function openModal() { setIsOpen(true); } - + // Function to apply styles to modal function afterOpenModal() { // references are now sync'd and can be accessed. subtitle.style.color = '#f00'; } - + // Function to close modal function closeModal() { setIsOpen(false); } - + // Function to handle passcode change const handlePasscodeChange = (e) => { setPasscode(e.target.value); }; - + // Function to handle download file const handleDownloadFile = () => { if (passcode) { axios.get(`${apiUrl}/api/files/${passcode}/`, {responseType: 'blob'})