Skip to content

Commit

Permalink
format write
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelp committed Jan 4, 2025
1 parent 235d344 commit a3f1832
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ export default function RegisterFormSettings({

const hasErrors = !isSubmitSuccessful && isSubmitted;
const oldResumeLink = useRef(originalData.resume);
let f = new File([originalData.resume], oldResumeLink.current.split("/").pop()!);
let f = new File(
[originalData.resume],
oldResumeLink.current.split("/").pop()!,
);
let newResumeLink: string = originalData.resume;

// used to prevent infinite re-renders
useEffect(() => {
if (oldResumeLink.current === c.noResumeProvidedURL) setUploadedFile(null);
if (oldResumeLink.current === c.noResumeProvidedURL)
setUploadedFile(null);
else setUploadedFile(f);
}, []);

Expand All @@ -118,7 +122,7 @@ export default function RegisterFormSettings({
(oldResumeLink.current !== c.noResumeProvidedURL &&
uploadedFile == null),
);
}, [isDirty, uploadedFile,isOldFile, oldResumeLink.current]);
}, [isDirty, uploadedFile, isOldFile, oldResumeLink.current]);

const universityValue = form.watch("university").toLowerCase();
const shortID = form.watch("schoolID").toLowerCase();
Expand Down Expand Up @@ -1026,7 +1030,9 @@ export default function RegisterFormSettings({
{uploadedFile ? (
isOldFile ? (
<Link
href={oldResumeLink.current}
href={
oldResumeLink.current
}
>
{uploadedFile.name}{" "}
(
Expand Down

0 comments on commit a3f1832

Please sign in to comment.