Add some useEffect dependencies (#289)
This commit is contained in:
parent
cd602755be
commit
3db1de6b66
|
@ -68,7 +68,7 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
if (router.asPath.endsWith(`#${answerElementId}`)) {
|
if (router.asPath.endsWith(`#${answerElementId}`)) {
|
||||||
setHighlighted(true)
|
setHighlighted(true)
|
||||||
}
|
}
|
||||||
}, [router.asPath])
|
}, [answerElementId, router.asPath])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col className={'flex-1 gap-2'}>
|
<Col className={'flex-1 gap-2'}>
|
||||||
|
|
|
@ -132,7 +132,7 @@ export function FeedComment(props: {
|
||||||
if (router.asPath.endsWith(`#${comment.id}`)) {
|
if (router.asPath.endsWith(`#${comment.id}`)) {
|
||||||
setHighlighted(true)
|
setHighlighted(true)
|
||||||
}
|
}
|
||||||
}, [router.asPath])
|
}, [comment.id, router.asPath])
|
||||||
|
|
||||||
// Only calculated if they don't have a matching bet
|
// Only calculated if they don't have a matching bet
|
||||||
const { userPosition, outcome } = getBettorsLargestPositionBeforeTime(
|
const { userPosition, outcome } = getBettorsLargestPositionBeforeTime(
|
||||||
|
@ -287,7 +287,7 @@ export function CommentInput(props: {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!replyToUsername || !user || replyToUsername === user.username) return
|
if (!replyToUsername || !user || replyToUsername === user.username) return
|
||||||
const replacement = `@${replyToUsername} `
|
const replacement = `@${replyToUsername} `
|
||||||
setComment(replacement + comment.replace(replacement, ''))
|
setComment((comment) => replacement + comment.replace(replacement, ''))
|
||||||
}, [user, replyToUsername])
|
}, [user, replyToUsername])
|
||||||
|
|
||||||
async function submitComment(betId: string | undefined) {
|
async function submitComment(betId: string | undefined) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user