diff --git a/web/components/feed/feed-answer-comment-group.tsx b/web/components/feed/feed-answer-comment-group.tsx index 958b6d6d..47cb9743 100644 --- a/web/components/feed/feed-answer-comment-group.tsx +++ b/web/components/feed/feed-answer-comment-group.tsx @@ -11,7 +11,6 @@ import clsx from 'clsx' import { ContractCommentInput, FeedComment, - getMostRecentCommentableBet, } from 'web/components/feed/feed-comments' import { CopyLinkDateTimeComponent } from 'web/components/feed/copy-link-date-time' import { useRouter } from 'next/router' @@ -50,27 +49,6 @@ export function FeedAnswerCommentGroup(props: { const answerElementId = `answer-${answer.id}` const commentsByCurrentUser = (user && commentsByUserId[user.id]) ?? [] const isFreeResponseContractPage = !!commentsByCurrentUser - const mostRecentCommentableBet = getMostRecentCommentableBet( - betsByCurrentUser, - commentsByCurrentUser, - user, - answer.number.toString() - ) - 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?: ContractComment, answer?: Answer) => { @@ -85,19 +63,6 @@ export function FeedAnswerCommentGroup(props: { } ) - useEffect(() => { - // Only show one comment input for a bet at a time - if ( - betsByCurrentUser.length > 1 && - // inputRef?.textContent?.length === 0 && //TODO: editor.isEmpty - betsByCurrentUser.sort((a, b) => b.createdTime - a.createdTime)[0] - ?.outcome !== answer.number.toString() - ) - setShowReply(false) - // Even if we pass memoized bets this still runs on every render, which we don't want - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [betsByCurrentUser.length, user, answer.number]) - useEffect(() => { if (router.asPath.endsWith(`#${answerElementId}`)) { setHighlighted(true) @@ -105,10 +70,7 @@ export function FeedAnswerCommentGroup(props: { }, [answerElementId, router.asPath]) return ( - + {isFreeResponseContractPage && ( -
+