mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix: incorrect pathname check would scroll to reply unexpectedly
This commit is contained in:
@@ -2,7 +2,7 @@ import { useMemo, useCallback } from 'react';
|
||||
import { Comment, useAccountComments } from '@plebbit/plebbit-react-hooks';
|
||||
import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/utils';
|
||||
|
||||
const useRepliesAndAccountReplies = (comment: Comment) => {
|
||||
const useReplies = (comment: Comment) => {
|
||||
// flatten all replies including nested ones from the original comment
|
||||
const flattenedReplies = useMemo(() => flattenCommentsPages(comment.replies), [comment.replies]);
|
||||
|
||||
@@ -45,4 +45,4 @@ const useRepliesAndAccountReplies = (comment: Comment) => {
|
||||
return repliesAndNotYetPublishedReplies;
|
||||
};
|
||||
|
||||
export default useRepliesAndAccountReplies;
|
||||
export default useReplies;
|
||||
|
||||
Reference in New Issue
Block a user