Skip to content

Commit

Permalink
set isViewed and isUploaded to true when file has already been upload…
Browse files Browse the repository at this point in the history
…ed into database, include message for pdf size limit
  • Loading branch information
ashleyleal committed Jul 30, 2024
1 parent bb18f19 commit 5b7242f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/src/pages/FroshRetreat/FroshRetreat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ const RetreatRegistration = () => {
outOfTicketsSetter();
}, []);

useEffect(() => {
if (isWaiverUploaded) {
setViewedWaiver(true);
setIsUploaded(true);
}
}, [isWaiverUploaded]);

const handleFileChange = (event) => {
setFile(event.target.files[0]);
};
Expand Down Expand Up @@ -334,7 +341,7 @@ const RetreatRegistration = () => {

<div className="display-field">
<h3>UPLOAD SIGNED WAIVER:</h3>
<p>Only PDF files are accepted</p>
<p>Only PDF files under 1 MB are accepted</p>
{viewedWaiver ? (
<>
<input type="file" accept=".pdf" onChange={handleFileChange} />
Expand Down

0 comments on commit 5b7242f

Please sign in to comment.