Fix spooky bets hook code
This commit is contained in:
parent
9840742927
commit
c2da7bc99f
|
@ -26,9 +26,7 @@ export function FeedBet(props: {
|
||||||
const { userId, createdTime } = bet
|
const { userId, createdTime } = bet
|
||||||
|
|
||||||
const isBeforeJune2022 = dayjs(createdTime).isBefore('2022-06-01')
|
const isBeforeJune2022 = dayjs(createdTime).isBefore('2022-06-01')
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
const bettor = useUserById(userId)
|
||||||
const bettor = isBeforeJune2022 ? undefined : useUserById(userId)
|
|
||||||
|
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
const isSelf = user?.id === userId
|
const isSelf = user?.id === userId
|
||||||
|
|
||||||
|
@ -42,7 +40,7 @@ export function FeedBet(props: {
|
||||||
avatarUrl={user.avatarUrl}
|
avatarUrl={user.avatarUrl}
|
||||||
username={user.username}
|
username={user.username}
|
||||||
/>
|
/>
|
||||||
) : bettor ? (
|
) : bettor && !isBeforeJune2022 ? (
|
||||||
<Avatar
|
<Avatar
|
||||||
className={clsx(smallAvatar && 'ml-1')}
|
className={clsx(smallAvatar && 'ml-1')}
|
||||||
size={smallAvatar ? 'sm' : undefined}
|
size={smallAvatar ? 'sm' : undefined}
|
||||||
|
@ -59,7 +57,7 @@ export function FeedBet(props: {
|
||||||
bet={bet}
|
bet={bet}
|
||||||
contract={contract}
|
contract={contract}
|
||||||
isSelf={isSelf}
|
isSelf={isSelf}
|
||||||
bettor={bettor}
|
bettor={!isBeforeJune2022 ? bettor : undefined}
|
||||||
hideOutcome={hideOutcome}
|
hideOutcome={hideOutcome}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user