Includes=>endsWith for multi digit answers

This commit is contained in:
Ian Philips 2022-05-17 10:13:29 -06:00
parent ef98c16c26
commit d458d8a299
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ export function FeedAnswerCommentGroup(props: {
const [highlighted, setHighlighted] = useState(false)
const router = useRouter()
useEffect(() => {
if (router.asPath.includes(`#${answerElementId}`)) {
if (router.asPath.endsWith(`#${answerElementId}`)) {
setHighlighted(true)
}
}, [router.asPath])

View File

@ -213,7 +213,7 @@ export function FeedComment(props: {
const [highlighted, setHighlighted] = useState(false)
const router = useRouter()
useEffect(() => {
if (router.asPath.includes(`#${comment.id}`)) {
if (router.asPath.endsWith(`#${comment.id}`)) {
setHighlighted(true)
}
}, [router.asPath])