From c2da7bc99f2bef1baf2e0df594285335053536b4 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Sun, 24 Jul 2022 14:02:58 -0700 Subject: [PATCH] Fix spooky bets hook code --- web/components/feed/feed-bets.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/components/feed/feed-bets.tsx b/web/components/feed/feed-bets.tsx index 408404ba..29037de7 100644 --- a/web/components/feed/feed-bets.tsx +++ b/web/components/feed/feed-bets.tsx @@ -26,9 +26,7 @@ export function FeedBet(props: { const { userId, createdTime } = bet const isBeforeJune2022 = dayjs(createdTime).isBefore('2022-06-01') - // eslint-disable-next-line react-hooks/rules-of-hooks - const bettor = isBeforeJune2022 ? undefined : useUserById(userId) - + const bettor = useUserById(userId) const user = useUser() const isSelf = user?.id === userId @@ -42,7 +40,7 @@ export function FeedBet(props: { avatarUrl={user.avatarUrl} username={user.username} /> - ) : bettor ? ( + ) : bettor && !isBeforeJune2022 ? (