Skip to content
Snippets Groups Projects
Commit a166fe26 authored by Tamim Almahdi's avatar Tamim Almahdi
Browse files

Ensure user logged in during user call

parent 116dfc50
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ export default function User() {
const [isFollowing, setIsFollowing] = useState(false);
const [user, setUser] = useState();
const [allRatings, setAllRatings] = useState({ ratings: [] });
const { userID } = useContext(AuthContext);
const { userID, authState } = useContext(AuthContext);
function getUser() {
const data = { userID: id };
axios
......@@ -206,7 +206,7 @@ export default function User() {
followUser={followUser}
/>
<div className="followButton">
{isFollowing ? (
{authState && isFollowing ? (
<button className="bubble-button" onClick={() => unfollowUser()}>
Unfollow
</button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment