feat: 메인 라이브

- 여러개로 나눠져 있던 API 하나로 병합
This commit is contained in:
Yu Sung
2025-07-22 03:03:47 +09:00
parent 5d0b23d10d
commit 33195e5c8e
6 changed files with 97 additions and 251 deletions

View File

@@ -69,7 +69,7 @@ struct LiveView: View {
}
},
onClickRefresh: {
viewModel.getSummary()
viewModel.getLiveMain()
}
)
@@ -92,7 +92,7 @@ struct LiveView: View {
SectionLiveReservationView(
items: viewModel.liveReservationItems,
onClickCancel: { viewModel.getSummary() },
onClickCancel: { viewModel.getLiveMain() },
onClickStart: { roomId in
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
processStart(roomId: roomId)
@@ -119,7 +119,7 @@ struct LiveView: View {
.padding(.vertical, 24)
}
.onAppear {
viewModel.getSummary()
viewModel.getLiveMain()
}
}
@@ -159,10 +159,7 @@ struct LiveView: View {
)
}
if viewModel.isFollowedChannelLoading ||
viewModel.isRecommendChannelLoading ||
viewModel.isRecommendLiveLoading ||
viewModel.isLoading {
if viewModel.isLoading {
LoadingView()
}
}
@@ -188,7 +185,7 @@ struct LiveView: View {
}
private func onCreateSuccess(response: CreateLiveRoomResponse) {
viewModel.getSummary()
viewModel.getLiveMain()
if let _ = response.channelName {
viewModel.enterRoom(roomId: response.id!)
}