From 2fcc57dbba68025855ed070bbd8031ef7935da2c Mon Sep 17 00:00:00 2001 From: saltrafael Date: Mon, 21 Jun 2021 11:06:16 -0300 Subject: [PATCH] lint --- ui/component/livestreamComments/view.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/component/livestreamComments/view.jsx b/ui/component/livestreamComments/view.jsx index 0058d8adb..5d570355b 100644 --- a/ui/component/livestreamComments/view.jsx +++ b/ui/component/livestreamComments/view.jsx @@ -84,8 +84,8 @@ export default function LivestreamComments(props: Props) { function handleScroll() { if (discussionElement) { - const negativeCommentHeight = (-1 * commentElement.offsetHeight); - const isAtRecent = discussionElement.scrollTop >= negativeCommentHeight; + const negativeCommentHeight = commentElement && (-1 * commentElement.offsetHeight); + const isAtRecent = negativeCommentHeight && (discussionElement.scrollTop >= negativeCommentHeight); setScrollBottom(isAtRecent); }