Fixing post_view glitch. Fixes #740 (#741)

This commit is contained in:
Dessalines 2022-08-04 10:28:58 -04:00 committed by GitHub
parent b12c606982
commit b0cfb4fe4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ import {
SearchResponse,
SearchType,
SortType,
toOption,
UserOperation,
wsJsonToRes,
wsUserOp,
@ -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 => (