refactor: cleanup CommentsSheet

This commit is contained in:
Bnyro 2023-07-31 15:22:07 +02:00
parent c4cc2ca6ac
commit 508573a1c1

View File

@ -12,13 +12,16 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class CommentsViewModel : ViewModel() {
private var isLoading = false
val commentsPage = MutableLiveData<CommentsPage?>()
val commentSheetExpand = MutableLiveData<Boolean?>()
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) {