Includes=>endsWith for multi digit answers
This commit is contained in:
parent
ef98c16c26
commit
d458d8a299
|
@ -61,7 +61,7 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
const [highlighted, setHighlighted] = useState(false)
|
const [highlighted, setHighlighted] = useState(false)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (router.asPath.includes(`#${answerElementId}`)) {
|
if (router.asPath.endsWith(`#${answerElementId}`)) {
|
||||||
setHighlighted(true)
|
setHighlighted(true)
|
||||||
}
|
}
|
||||||
}, [router.asPath])
|
}, [router.asPath])
|
||||||
|
|
|
@ -213,7 +213,7 @@ export function FeedComment(props: {
|
||||||
const [highlighted, setHighlighted] = useState(false)
|
const [highlighted, setHighlighted] = useState(false)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (router.asPath.includes(`#${comment.id}`)) {
|
if (router.asPath.endsWith(`#${comment.id}`)) {
|
||||||
setHighlighted(true)
|
setHighlighted(true)
|
||||||
}
|
}
|
||||||
}, [router.asPath])
|
}, [router.asPath])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user