diff --git a/SodaLive/Sources/Live/LiveViewModel.swift b/SodaLive/Sources/Live/LiveViewModel.swift index 3688c31..6099767 100644 --- a/SodaLive/Sources/Live/LiveViewModel.swift +++ b/SodaLive/Sources/Live/LiveViewModel.swift @@ -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) diff --git a/SodaLive/Sources/Live/Now/All/LiveNowAllView.swift b/SodaLive/Sources/Live/Now/All/LiveNowAllView.swift index 6d8c9fc..37baba9 100644 --- a/SodaLive/Sources/Live/Now/All/LiveNowAllView.swift +++ b/SodaLive/Sources/Live/Now/All/LiveNowAllView.swift @@ -24,6 +24,8 @@ struct LiveNowAllView: View { RefreshableScrollView( refreshing: $viewModel.isRefresh, action: { + viewModel.page = 1 + viewModel.isLast = false viewModel.getLiveNowList() }, content: {