Closed Abbeyme1 closed 4 years ago
I think the logic for follow and unfollow is incomplete as when we follow a user and then we refresh , we can follow that user again .
ACCORIDING TO ME WE CAN USE THIS LOGIC TO AVOID FOLLOWING THE SAME PERSON AGAIN AND AGAIN
useEffect(() => { user && mainUser && (user.user.followers.includes(mainUser._id) ? setShowFollow(false) : setShowFollow(true)); }, [user]);
I think the logic for follow and unfollow is incomplete as when we follow a user and then we refresh , we can follow that user again .
ACCORIDING TO ME WE CAN USE THIS LOGIC TO AVOID FOLLOWING THE SAME PERSON AGAIN AND AGAIN