From 8eae6e3be590fb65f0e9c820b3ad1133591a6fa0 Mon Sep 17 00:00:00 2001 From: Drake <150128459+VialsShiny@users.noreply.github.com> Date: Wed, 26 Nov 2025 23:08:31 +0100 Subject: [PATCH 1/2] Eslint Fix --- frontend/package.json | 1 + frontend/src/components/features/posts/Post.jsx | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 712677a..a1acb7c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,6 +7,7 @@ "build": "vite build", "preview": "vite preview", "lint": "eslint . --ext js,jsx --report-unused-disable-directives", + "lint:fix": "eslint --fix --ext .js,.jsx .", "test": "vitest run", "lhci": "lhci" }, diff --git a/frontend/src/components/features/posts/Post.jsx b/frontend/src/components/features/posts/Post.jsx index 794677d..ee96e0f 100644 --- a/frontend/src/components/features/posts/Post.jsx +++ b/frontend/src/components/features/posts/Post.jsx @@ -24,16 +24,19 @@ function Post({ const [commented, setComment] = useState(false); const [saved, setSaved] = useState(false); const [IsOpen, setIsOpen] = useState(false); - const [savePP, setSavePP] = useState(author_imgUrl); + const savePP = author_imgUrl; const [newComments, setNewComments] = useState(comments); - useEffect(() => { + useEffect((id) => { if (userLikes[id]) setLiked(true); }, []); - useEffect(() => { - handleLikes(setNewLikes, liked, id); - }, [liked]); + useEffect( + (id) => { + handleLikes(setNewLikes, liked, id); + }, + [liked] + ); useEffect(() => { const interval = setInterval(() => { From 43de697594cb77054202f330b6cfcb1460c63d07 Mon Sep 17 00:00:00 2001 From: Drake <150128459+VialsShiny@users.noreply.github.com> Date: Wed, 26 Nov 2025 23:09:13 +0100 Subject: [PATCH 2/2] Fixing SignIn/Up --- frontend/src/pages/SignIn.jsx | 2 +- frontend/src/pages/SignUp.jsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/SignIn.jsx b/frontend/src/pages/SignIn.jsx index fa66e17..39fdcea 100644 --- a/frontend/src/pages/SignIn.jsx +++ b/frontend/src/pages/SignIn.jsx @@ -53,7 +53,7 @@ export default function SignIn() { password: passwordValidation === true ? null : passwordValidation, }; - const hasErrors = Object.values(errors).some((err) => err !== null); + const hasErrors = Object.values(errors).some((err) => err == null); if (hasErrors) { setDisplayError(errors); diff --git a/frontend/src/pages/SignUp.jsx b/frontend/src/pages/SignUp.jsx index b9d2d3f..76ceb31 100644 --- a/frontend/src/pages/SignUp.jsx +++ b/frontend/src/pages/SignUp.jsx @@ -68,13 +68,14 @@ export default function SignUp() { }; const hasErrors = Object.values(validationErrors).some( - (err) => err !== null + (err) => err == null ); if (hasErrors) { setDisplayError({ ...displayError, ...validationErrors, }); + console.log('teste'); setIsLoading(false); return; }