diff --git a/app/src/main/java/com/github/libretube/ui/models/CommentsViewModel.kt b/app/src/main/java/com/github/libretube/ui/models/CommentsViewModel.kt index d92e673a0..8db9afdca 100644 --- a/app/src/main/java/com/github/libretube/ui/models/CommentsViewModel.kt +++ b/app/src/main/java/com/github/libretube/ui/models/CommentsViewModel.kt @@ -12,13 +12,16 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch class CommentsViewModel : ViewModel() { - private var isLoading = false - val commentsPage = MutableLiveData() - val commentSheetExpand = MutableLiveData() + var videoId: String? = null + private var nextPage: String? = null + private var isLoading = false + var maxHeight = 0 var currentCommentsPosition = 0 + var commentsSheetDismiss: (() -> Unit)? = null + var handleLink: ((url: String) -> Unit)? = null fun setCommentSheetExpand(value: Boolean?) { if (commentSheetExpand.value != value) { @@ -26,13 +29,6 @@ class CommentsViewModel : ViewModel() { } } - private var nextPage: String? = null - - var videoId: String? = null - var maxHeight: Int = 0 - var commentsSheetDismiss: (() -> Unit)? = null - var handleLink: ((url: String) -> Unit)? = null - fun fetchComments() { videoId ?: return viewModelScope.launch(Dispatchers.IO) {