From 77402b064f080e4e2efcca7912736c3554e1100b Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 27 Nov 2022 17:39:19 +0100 Subject: [PATCH] fix duplicated comments --- .../java/com/github/libretube/ui/sheets/CommentsSheet.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/sheets/CommentsSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/CommentsSheet.kt index 007d7eb19..53922e5c7 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/CommentsSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/CommentsSheet.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.withContext class CommentsSheet( private val videoId: String, - private val comments: MutableList, + private val comments: List, private var nextPage: String?, private val onMoreComments: (comments: List, nextPage: String?) -> Unit ) : ExpandedBottomSheet() { @@ -45,7 +45,7 @@ class CommentsSheet( } } - commentsAdapter = CommentsAdapter(videoId, comments) { + commentsAdapter = CommentsAdapter(videoId, comments.toMutableList()) { dialog?.dismiss() } binding.commentsRV.adapter = commentsAdapter @@ -60,7 +60,6 @@ class CommentsSheet( val response = try { RetrofitInstance.api.getComments(videoId) } catch (e: Exception) { - Log.e(TAG(), e.toString()) return@launchWhenCreated } binding.progress.visibility = View.GONE