fix(creator): 라이브 더보기 상태 보존을 보정한다
This commit is contained in:
@@ -58,8 +58,11 @@ class CreatorChannelLiveViewModel(
|
||||
val data = response.data
|
||||
val current = _liveStateLiveData.value as? CreatorChannelLiveUiState.Content ?: content
|
||||
if (response.success && data != null) {
|
||||
_liveStateLiveData.value = data.toContentState(
|
||||
_liveStateLiveData.value = current.copy(
|
||||
liveReplayContents = current.liveReplayContents + data.liveReplayContents,
|
||||
page = data.page,
|
||||
size = data.size,
|
||||
hasNext = data.hasNext,
|
||||
isLoadingMore = false
|
||||
)
|
||||
} else {
|
||||
@@ -71,6 +74,13 @@ class CreatorChannelLiveViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
fun consumePaginationErrorMessage() {
|
||||
val content = _liveStateLiveData.value as? CreatorChannelLiveUiState.Content ?: return
|
||||
if (content.paginationErrorMessage == null) return
|
||||
|
||||
_liveStateLiveData.value = content.copy(paginationErrorMessage = null)
|
||||
}
|
||||
|
||||
private fun loadFirstPage(sort: ContentSort) {
|
||||
val generation = ++requestGeneration
|
||||
_liveStateLiveData.value = CreatorChannelLiveUiState.Loading
|
||||
|
||||
Reference in New Issue
Block a user