From b0cfb4fe4a12111755cc54e01f84de08f4b83856 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 4 Aug 2022 10:28:58 -0400 Subject: [PATCH] Fixing post_view glitch. Fixes #740 (#741) --- src/shared/components/post/post.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index e8b86192..33e0978e 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -27,6 +27,7 @@ import { SearchResponse, SearchType, SortType, + toOption, UserOperation, wsJsonToRes, wsUserOp, @@ -569,8 +570,10 @@ export class Post extends Component { } 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 => (