지금 라이브 중 전체보기 - 당겨서 새로고침이 되지 않던 버그 수정
This commit is contained in:
parent
3387a1b369
commit
bfcc430349
|
@ -294,6 +294,7 @@ final class LiveViewModel: ObservableObject {
|
|||
ERROR_LOG(error.localizedDescription)
|
||||
}
|
||||
} receiveValue: { [unowned self] response in
|
||||
self.isRefresh = false
|
||||
self.isLoading = false
|
||||
let responseData = response.data
|
||||
|
||||
|
@ -302,6 +303,10 @@ final class LiveViewModel: ObservableObject {
|
|||
let decoded = try jsonDecoder.decode(ApiResponse<[GetRoomListResponse]>.self, from: responseData)
|
||||
|
||||
if let data = decoded.data, decoded.success {
|
||||
if page < 2 {
|
||||
self.liveNowItems.removeAll()
|
||||
}
|
||||
|
||||
if !data.isEmpty {
|
||||
page += 1
|
||||
self.liveNowItems.append(contentsOf: data)
|
||||
|
|
|
@ -24,6 +24,8 @@ struct LiveNowAllView: View {
|
|||
RefreshableScrollView(
|
||||
refreshing: $viewModel.isRefresh,
|
||||
action: {
|
||||
viewModel.page = 1
|
||||
viewModel.isLast = false
|
||||
viewModel.getLiveNowList()
|
||||
},
|
||||
content: {
|
||||
|
|
Loading…
Reference in New Issue