fix(live): 라이브 상세 표시를 보정한다
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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]()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user