Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/components/features/posts/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
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);
}, []);

Check warning on line 32 in frontend/src/components/features/posts/Post.jsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'userLikes'. Either include it or remove the dependency array

useEffect(() => {
handleLikes(setNewLikes, liked, id);
}, [liked]);
useEffect(
(id) => {
handleLikes(setNewLikes, liked, id);
},
[liked]
);

useEffect(() => {
const interval = setInterval(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/SignIn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading