mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
refactor: cleanup CommentsSheet
This commit is contained in:
parent
c4cc2ca6ac
commit
508573a1c1
@ -12,13 +12,16 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class CommentsViewModel : ViewModel() {
|
class CommentsViewModel : ViewModel() {
|
||||||
private var isLoading = false
|
|
||||||
|
|
||||||
val commentsPage = MutableLiveData<CommentsPage?>()
|
val commentsPage = MutableLiveData<CommentsPage?>()
|
||||||
|
|
||||||
val commentSheetExpand = MutableLiveData<Boolean?>()
|
val commentSheetExpand = MutableLiveData<Boolean?>()
|
||||||
|
|
||||||
|
var videoId: String? = null
|
||||||
|
private var nextPage: String? = null
|
||||||
|
private var isLoading = false
|
||||||
|
var maxHeight = 0
|
||||||
var currentCommentsPosition = 0
|
var currentCommentsPosition = 0
|
||||||
|
var commentsSheetDismiss: (() -> Unit)? = null
|
||||||
|
var handleLink: ((url: String) -> Unit)? = null
|
||||||
|
|
||||||
fun setCommentSheetExpand(value: Boolean?) {
|
fun setCommentSheetExpand(value: Boolean?) {
|
||||||
if (commentSheetExpand.value != value) {
|
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() {
|
fun fetchComments() {
|
||||||
videoId ?: return
|
videoId ?: return
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
Loading…
Reference in New Issue
Block a user