Skip to content

Commit

Permalink
bugFixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Student authored and Student committed Jul 21, 2023
1 parent 644c11b commit 82ad183
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/components/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Home = ({ user, addPoints }) => {
const [submit, setSubmit] = useState(false);


let startCount = parseInt(posts.likes || 0)
let startCount = parseInt(posts.likes || 0);
const [countLikes, setCountLikes] = useState(startCount);


Expand Down Expand Up @@ -92,9 +92,9 @@ const Home = ({ user, addPoints }) => {
.catch((err) => {
console.error("ERROR in axios put request at handleLikeClick: ", err);
});
fetchData();
}
}, [countLikes]);
fetchData();
};
}, [countLikes]);


return (
Expand Down
7 changes: 6 additions & 1 deletion client/components/UserProfile.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react';
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { useSelector, useDispatch } from 'react-redux';
import { setAuthUser } from './store/appSlice';
Expand Down Expand Up @@ -98,6 +98,11 @@ const UserProfile = () => {
window.location.href = 'http://127.0.0.1:4000';
};

// if there's no user return loading
if (!authUser) {
return <div>Loading...</div>;
}

const isSaveProfileDisabled = !isImageSelected;
const isSaveUsernameDisabled = !updatedUsername;
const isSaveStatusDisabled = !updatedStatus;
Expand Down
Binary file added server/public/uploads/1689982571680-killua.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/public/uploads/1689983665861-killua.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 82ad183

Please sign in to comment.