Display refered by publicly

This commit is contained in:
Ian Philips 2022-07-04 09:18:01 -06:00
parent 22f917e250
commit 790fdad1e3

View File

@ -50,17 +50,12 @@ function ReferralsDialog(props: {
const [referredByUser, setReferredByUser] = useState<User | null>()
useEffect(() => {
if (
isOpen &&
!referredByUser &&
currentUser?.referredByUserId &&
currentUser.id === user.id
) {
getUser(currentUser.referredByUserId).then((user) => {
if (isOpen && !referredByUser && user?.referredByUserId) {
getUser(user.referredByUserId).then((user) => {
setReferredByUser(user)
})
}
}, [currentUser, isOpen, referredByUser, user.id])
}, [isOpen, referredByUser, user.referredByUserId])
useEffect(() => {
prefetchUsers(referralIds)