Comments Pagination #6390

Merged
infinite-persistence merged 8 commits from ip/comment.pagination into master 2021-07-14 16:42:11 +02:00
Showing only changes of commit 5ef95846d8 - Show all commits

View file

@ -24,6 +24,8 @@ import CommentMenuList from 'component/commentMenuList';
import UriIndicator from 'component/uriIndicator';
import CreditAmount from 'component/common/credit-amount';
const AUTO_EXPAND_ALL_REPLIES = false;
type Props = {
clearPlayingUri: () => void,
uri: string,
@ -124,11 +126,12 @@ function Comment(props: Props) {
// Auto-expand (limited to linked-comments for now, but can be for all)
useEffect(() => {
if (
const isInLinkedCommentChain =
linkedCommentId &&
linkedCommentAncestors[linkedCommentId] &&
linkedCommentAncestors[linkedCommentId].includes(commentId)
) {
linkedCommentAncestors[linkedCommentId].includes(commentId);
if (isInLinkedCommentChain || AUTO_EXPAND_ALL_REPLIES) {
setShowReplies(true);
setPage(1);
}