fix: user detail pagination
This commit is contained in:
parent
44cabf3dbd
commit
b15b22deb1
@ -190,7 +190,7 @@ class UserDetailViewModel(
|
|||||||
initial = initial,
|
initial = initial,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
mvi.scope?.launch {
|
mvi.scope?.launch(Dispatchers.IO) {
|
||||||
val auth = identityRepository.authToken.value
|
val auth = identityRepository.authToken.value
|
||||||
val refreshedUser = if (otherInstance.isNotEmpty()) {
|
val refreshedUser = if (otherInstance.isNotEmpty()) {
|
||||||
userRepository.getOnOtherInstance(
|
userRepository.getOnOtherInstance(
|
||||||
@ -265,6 +265,9 @@ class UserDetailViewModel(
|
|||||||
refreshing = false,
|
refreshing = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (!itemList.isNullOrEmpty()) {
|
||||||
|
currentPage++
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val itemList = userRepository.getComments(
|
val itemList = userRepository.getComments(
|
||||||
auth = auth,
|
auth = auth,
|
||||||
@ -287,8 +290,10 @@ class UserDetailViewModel(
|
|||||||
initial = false,
|
initial = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (!itemList.isNullOrEmpty()) {
|
||||||
|
currentPage++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentPage++
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user