diff --git a/web/components/feed/feed-answer-comment-group.tsx b/web/components/feed/feed-answer-comment-group.tsx index 7bc5e91f..2cf7ac20 100644 --- a/web/components/feed/feed-answer-comment-group.tsx +++ b/web/components/feed/feed-answer-comment-group.tsx @@ -69,9 +69,21 @@ export function FeedAnswerCommentGroup(props: { user, answer.number.toString() ) - const [usersMostRecentBetTimeAtLoad] = useState( - mostRecentCommentableBet?.createdTime ?? 0 - ) + const [usersMostRecentBetTimeAtLoad, setUsersMostRecentBetTimeAtLoad] = + useState( + !user ? undefined : mostRecentCommentableBet?.createdTime ?? 0 + ) + + useEffect(() => { + if (user && usersMostRecentBetTimeAtLoad === undefined) + setUsersMostRecentBetTimeAtLoad( + mostRecentCommentableBet?.createdTime ?? 0 + ) + }, [ + mostRecentCommentableBet?.createdTime, + user, + usersMostRecentBetTimeAtLoad, + ]) const scrollAndOpenReplyInput = useEvent( (comment?: Comment, answer?: Answer) => { @@ -84,6 +96,7 @@ export function FeedAnswerCommentGroup(props: { useEffect(() => { if ( mostRecentCommentableBet && + usersMostRecentBetTimeAtLoad !== undefined && mostRecentCommentableBet.createdTime > usersMostRecentBetTimeAtLoad && !showReply )