prevent crash when deleting last reply (still needs work)
This commit is contained in:
parent
1891107a80
commit
e1a66d389f
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ function CommentsReplies(props: Props) {
|
||||||
const [commentsToDisplay, setCommentsToDisplay] = React.useState(fetchedReplies);
|
const [commentsToDisplay, setCommentsToDisplay] = React.useState(fetchedReplies);
|
||||||
const isResolvingReplies = fetchedReplies && resolvedReplies.length !== fetchedReplies.length;
|
const isResolvingReplies = fetchedReplies && resolvedReplies.length !== fetchedReplies.length;
|
||||||
const alreadyResolved = !isResolvingReplies && resolvedReplies.length !== 0;
|
const alreadyResolved = !isResolvingReplies && resolvedReplies.length !== 0;
|
||||||
const canDisplayComments = commentsToDisplay && commentsToDisplay.length === fetchedReplies.length;
|
const canDisplayComments = commentsToDisplay && fetchedReplies && commentsToDisplay.length === fetchedReplies.length;
|
||||||
|
|
||||||
// Batch resolve comment channel urls
|
// Batch resolve comment channel urls
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
@ -106,7 +106,7 @@ function CommentsReplies(props: Props) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{(isFetchingByParentId[parentId] || isResolvingReplies || !canDisplayComments) && (
|
{(isFetchingByParentId[parentId] || isResolvingReplies || (!fetchedReplies && !canDisplayComments)) && (
|
||||||
<div className="comment__replies-container">
|
<div className="comment__replies-container">
|
||||||
<div className="comment__actions--nested">
|
<div className="comment__actions--nested">
|
||||||
<Spinner type="small" />
|
<Spinner type="small" />
|
||||||
|
|
Loading…
Reference in a new issue