From a3302b1be80a0efe2743bf1792f76b77de0bda3e Mon Sep 17 00:00:00 2001 From: saltrafael Date: Thu, 14 Oct 2021 08:28:14 -0300 Subject: [PATCH] Fix expansion broken with layout change --- ui/component/commentsList/view.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/component/commentsList/view.jsx b/ui/component/commentsList/view.jsx index 58d1a4387..dab4dd4be 100644 --- a/ui/component/commentsList/view.jsx +++ b/ui/component/commentsList/view.jsx @@ -87,6 +87,7 @@ function CommentList(props: Props) { const isMobile = useIsMobile(); const isMediumScreen = useIsMediumScreen(); + const desktopView = !isMobile && !isMediumScreen; const spinnerRef = React.useRef(); const DEFAULT_SORT = ENABLE_COMMENT_REACTIONS ? SORT_BY.POPULARITY : SORT_BY.NEWEST; const [sort, setSort] = usePersistedState('comment-sort-by', DEFAULT_SORT); @@ -94,7 +95,7 @@ function CommentList(props: Props) { const fetchedCommentsOnce = useFetched(isFetchingComments); const fetchedReactsOnce = useFetched(isFetchingReacts); const fetchedLinkedComment = useFetched(isFetchingCommentsById); - const hasDefaultExpansion = commentsAreExpanded || (!isMobile && !isMediumScreen); + const hasDefaultExpansion = commentsAreExpanded || desktopView; const [expandedComments, setExpandedComments] = React.useState(hasDefaultExpansion); const totalFetchedComments = allCommentIds ? allCommentIds.length : 0; const channelId = getChannelIdFromClaim(claim); @@ -307,8 +308,8 @@ function CommentList(props: Props) {