Add AUTO_EXPAND_REPLIES flag to toggle the feature.
This commit is contained in:
parent
0cf6fe3df5
commit
5ef95846d8
1 changed files with 6 additions and 3 deletions
|
@ -24,6 +24,8 @@ import CommentMenuList from 'component/commentMenuList';
|
||||||
import UriIndicator from 'component/uriIndicator';
|
import UriIndicator from 'component/uriIndicator';
|
||||||
import CreditAmount from 'component/common/credit-amount';
|
import CreditAmount from 'component/common/credit-amount';
|
||||||
|
|
||||||
|
const AUTO_EXPAND_ALL_REPLIES = false;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
clearPlayingUri: () => void,
|
clearPlayingUri: () => void,
|
||||||
uri: string,
|
uri: string,
|
||||||
|
@ -124,11 +126,12 @@ function Comment(props: Props) {
|
||||||
|
|
||||||
// Auto-expand (limited to linked-comments for now, but can be for all)
|
// Auto-expand (limited to linked-comments for now, but can be for all)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
const isInLinkedCommentChain =
|
||||||
linkedCommentId &&
|
linkedCommentId &&
|
||||||
linkedCommentAncestors[linkedCommentId] &&
|
linkedCommentAncestors[linkedCommentId] &&
|
||||||
linkedCommentAncestors[linkedCommentId].includes(commentId)
|
linkedCommentAncestors[linkedCommentId].includes(commentId);
|
||||||
) {
|
|
||||||
|
if (isInLinkedCommentChain || AUTO_EXPAND_ALL_REPLIES) {
|
||||||
setShowReplies(true);
|
setShowReplies(true);
|
||||||
setPage(1);
|
setPage(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue