Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: sometimes the comment link in the notification cannot be highlighted after clicking

hgaold476f1ce9ffd
diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx
index 06ecfc26..9521ab55 100644
--- a/ui/src/components/Comment/index.tsx
+++ b/ui/src/components/Comment/index.tsx
@@ -73,7 +73,7 @@ const Comment = ({ objectId, mode, commentId }) => {
const { t } = useTranslation('translation', { keyPrefix: 'comment' });
useEffect(() => {
- if (pageIndex === 0 && commentId) {
+ if (pageIndex === 0 && commentId && comments.length !== 0) {
setTimeout(() => {
const el = document.getElementById(commentId);
scrollToElementTop(el);
@@ -84,7 +84,7 @@ const Comment = ({ objectId, mode, commentId }) => {
return () => {
updateCurrentReplyId('');
};
- }, []);
+ }, [comments]);
useEffect(() => {
if (!data) {