Skip to content

Commit

Permalink
Fixing post_view glitch. Fixes #740 (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines authored Aug 4, 2022
1 parent b12c606 commit b0cfb4f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/shared/components/post/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
SearchResponse,
SearchType,
SortType,
toOption,
UserOperation,
wsJsonToRes,
wsUserOp,
Expand Down Expand Up @@ -569,8 +570,10 @@ export class Post extends Component<any, PostState> {
}

commentsTree() {
let showContextButton =
getDepthFromComment(this.state.commentTree[0].comment_view.comment) > 0;
let showContextButton = toOption(this.state.commentTree[0]).match({
some: comment => getDepthFromComment(comment.comment_view.comment) > 0,
none: false,
});

return this.state.postRes.match({
some: res => (
Expand Down

0 comments on commit b0cfb4f

Please sign in to comment.