From 7b43e6fa378fe7231bc47edff25631832d2355f1 Mon Sep 17 00:00:00 2001 From: h Date: Thu, 23 Apr 2026 19:42:00 +0200 Subject: [PATCH] Show newest live chat messages on top --- .../newpipe/ui/components/video/comment/CommentSection.kt | 4 ++-- .../java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt index a42f11f15..4a5f9d470 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt @@ -77,7 +77,7 @@ private fun CommentSection( val commentInfo = uiState.data val count = commentInfo.commentCount - if (commentInfo.isCommentsDisabled) { + if (commentInfo.isCommentsDisabled && !commentInfo.isLiveChat) { item { EmptyStateComposable( spec = EmptyStateSpec.DisabledComments, @@ -87,7 +87,7 @@ private fun CommentSection( ) } - } else if (count == 0) { + } else if (count == 0 && !commentInfo.isLiveChat) { item { EmptyStateComposable( spec = EmptyStateSpec.NoComments, diff --git a/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt b/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt index 9f475d8d1..d5491f581 100644 --- a/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt +++ b/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt @@ -98,7 +98,7 @@ class CommentsViewModel(savedStateHandle: SavedStateHandle) : ViewModel() { ) Log.i(TAG, "liveChatPolling: fetched ${result.items.size} items, nextPage=${result.nextPage != null}") if (result.items.isNotEmpty()) { - _liveChatItems.value = _liveChatItems.value + result.items + _liveChatItems.value = result.items + _liveChatItems.value } nextPage = result.nextPage } catch (e: Exception) {