5742e1c2ca
## Issue - `Comment.replies` currently represent all replies, while `comment.List` returns a filtered version, so the actual replies could be less. - The actual replies is represented by `total_filtered_items`, but we only get that after making a fetch. So, users could click "Show more" but get nothing. ## Fix - Stop showing "Show more" based on `total_filtered_items`. - If there is a balance, display 1 dummy comment to represent all blocked replies. This handles the case of "Show more" being displayed but ended up with 0 replies if all replies were blocked. ## Future Note that `Comment.replies` might be changed to represented filtered comments in the near future (refer to Beamer), so the GUI is made such that the dummy just won't appear when that change happens.
20 lines
848 B
JavaScript
20 lines
848 B
JavaScript
import { connect } from 'react-redux';
|
|
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'lbry-redux';
|
|
import {
|
|
selectIsFetchingCommentsByParentId,
|
|
makeSelectRepliesForParentId,
|
|
makeSelectTotalRepliesForParentId,
|
|
} from 'redux/selectors/comments';
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import CommentsReplies from './view';
|
|
|
|
const select = (state, props) => ({
|
|
fetchedReplies: makeSelectRepliesForParentId(props.parentId)(state),
|
|
totalReplies: makeSelectTotalRepliesForParentId(props.parentId)(state),
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
|
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
|
myChannels: selectMyChannelClaims(state),
|
|
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
|
|
});
|
|
|
|
export default connect(select)(CommentsReplies);
|