fix(live): 라이브 상세 표시를 보정한다

This commit is contained in:
Yu Sung
2026-07-20 17:31:49 +09:00
parent dd5144ec3f
commit 43e32f1867
6 changed files with 190 additions and 22 deletions

View File

@@ -30,21 +30,6 @@ struct ContentView: View {
.navigationBarBackButtonHidden(true)
}
if let liveDetailSheet = appState.liveDetailSheet {
LiveDetailView(
roomId: liveDetailSheet.roomId,
onClickParticipant: liveDetailSheet.onClickParticipant,
onClickReservation: liveDetailSheet.onClickReservation,
onClickStart: liveDetailSheet.onClickStart,
onClickCancel: liveDetailSheet.onClickCancel,
onClickClose: {
withAnimation {
appState.hideLiveDetailSheet()
}
}
)
}
if isShowDialog {
SodaDialog(
title: I18n.Common.pointGrantTitle,
@@ -62,7 +47,6 @@ struct ContentView: View {
self.isShowDialog = true
}
}
.sodaToast(isPresented: $appState.isShowErrorPopup, message: appState.errorMessage, autohideIn: 1)
.navigationDestination(for: AppRoute.self) { route in
if let step = appState.appStep(for: route) {
AppStepLayerView(step: step, canPgPaymentViewModel: canPgPaymentViewModel)
@@ -75,6 +59,21 @@ struct ContentView: View {
}
.overlay {
ZStack {
if let liveDetailSheet = appState.liveDetailSheet {
LiveDetailView(
roomId: liveDetailSheet.roomId,
onClickParticipant: liveDetailSheet.onClickParticipant,
onClickReservation: liveDetailSheet.onClickReservation,
onClickStart: liveDetailSheet.onClickStart,
onClickCancel: liveDetailSheet.onClickCancel,
onClickClose: {
withAnimation {
appState.hideLiveDetailSheet()
}
}
)
}
if appState.isShowPlayer {
LiveRoomViewV2()
}
@@ -84,6 +83,7 @@ struct ContentView: View {
}
}
}
.sodaToast(isPresented: $appState.isShowErrorPopup, message: appState.errorMessage, autohideIn: 1)
}
private var leaveLiveNavigationDialog: some View {

View File

@@ -272,6 +272,10 @@ struct LiveDetailView: View {
.onAppear {
viewModel.getDetail(roomId: roomId)
}
.onChange(of: viewModel.isShowPopup) { isShowing in
guard isShowing, viewModel.room == nil else { return }
handleDetailLoadFailure()
}
}
@ViewBuilder
@@ -473,6 +477,18 @@ struct LiveDetailView: View {
}
}
private func handleDetailLoadFailure() {
let message = viewModel.errorMessage
viewModel.isShowPopup = false
AppState.shared.isShowErrorPopup = false
hideView()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
AppState.shared.errorMessage = message
AppState.shared.isShowErrorPopup = true
}
}
private func makeSnsItems(from manager: GetRoomDetailManager) -> [LiveDetailSnsItem] {
var items = [LiveDetailSnsItem]()

View File

@@ -506,9 +506,9 @@ struct CreatorChannelView: View {
guard targetId > 0 else { return }
switch type {
case .live, .liveReplay:
case .live:
showLiveDetail(targetId)
case .audio:
case .audio, .liveReplay:
showContentDetail(targetId)
case .community:
showCommunity(targetId)

View File

@@ -496,9 +496,9 @@ struct MainView: View {
guard targetId > 0 else { return }
switch type {
case .live, .liveReplay:
case .live:
handleRecommendationLiveTap(roomId: targetId)
case .audio:
case .audio, .liveReplay:
handleRecommendationContentTap(contentId: targetId)
case .community:
performRecommendationDetailAction {