fix(live): 라이브룸 전역 표시를 보정한다
This commit is contained in:
@@ -25,9 +25,6 @@ struct MainView: View {
|
||||
@State private var isShowAuthView = false
|
||||
@State private var isShowAuthConfirmView = false
|
||||
@State private var pendingAction: (() -> Void)? = nil
|
||||
@State private var isShowLeaveLiveNavigationDialog = false
|
||||
@State private var pendingExternalNavigationAction: (() -> Void)? = nil
|
||||
@State private var pendingExternalNavigationCancelAction: (() -> Void)? = nil
|
||||
@State private var payload = Payload()
|
||||
|
||||
var body: some View {
|
||||
@@ -106,14 +103,6 @@ struct MainView: View {
|
||||
if isShowPlayer {
|
||||
ContentPlayerView(isShowing: $isShowPlayer, playlist: [])
|
||||
}
|
||||
|
||||
if appState.isShowPlayer {
|
||||
LiveRoomViewV2()
|
||||
}
|
||||
|
||||
if isShowLeaveLiveNavigationDialog {
|
||||
leaveLiveNavigationDialog
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $isShowAuthView) {
|
||||
authView
|
||||
@@ -124,17 +113,6 @@ struct MainView: View {
|
||||
.valueChanged(value: appState.pushAudioContentId) { handlePushAudioContentId($0) }
|
||||
.valueChanged(value: appState.pushSeriesId) { handlePushSeriesId($0) }
|
||||
.valueChanged(value: appState.pendingMainChatFilter) { handlePendingMainChatFilter($0) }
|
||||
.valueChanged(value: appState.isShowPlayer) { isShowPlayer in
|
||||
guard !isShowPlayer,
|
||||
let pendingExternalNavigationAction = pendingExternalNavigationAction else {
|
||||
return
|
||||
}
|
||||
self.pendingExternalNavigationAction = nil
|
||||
self.pendingExternalNavigationCancelAction = nil
|
||||
DispatchQueue.main.async {
|
||||
pendingExternalNavigationAction()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
if appState.pushMessageId > 0 {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
@@ -306,22 +284,6 @@ struct MainView: View {
|
||||
pendingAction = nil
|
||||
}
|
||||
|
||||
private var leaveLiveNavigationDialog: some View {
|
||||
SodaV2ActionModal(
|
||||
title: I18n.Common.alertTitle,
|
||||
message: I18n.LiveRoom.leaveLiveForNavigationDesc,
|
||||
button1: SodaV2ActionModalButton(
|
||||
label: I18n.Common.confirm,
|
||||
action: confirmExternalNavigation
|
||||
),
|
||||
button2: SodaV2ActionModalButton(
|
||||
label: I18n.Common.cancel,
|
||||
action: cancelExternalNavigation
|
||||
),
|
||||
onDimmedTap: cancelExternalNavigation
|
||||
)
|
||||
}
|
||||
|
||||
private var authView: some View {
|
||||
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
|
||||
.onConfirm { _ in true }
|
||||
@@ -452,13 +414,10 @@ struct MainView: View {
|
||||
cancelAction: @escaping () -> Void
|
||||
) {
|
||||
guard value > 0 else { return }
|
||||
if appState.isShowPlayer {
|
||||
pendingExternalNavigationAction = navigationAction
|
||||
pendingExternalNavigationCancelAction = cancelAction
|
||||
isShowLeaveLiveNavigationDialog = true
|
||||
return
|
||||
}
|
||||
navigationAction()
|
||||
appState.requestExternalNavigation(
|
||||
navigationAction: navigationAction,
|
||||
cancelAction: cancelAction
|
||||
)
|
||||
}
|
||||
|
||||
private func handleHomeCanChargeTap() {
|
||||
@@ -692,22 +651,6 @@ struct MainView: View {
|
||||
AppState.shared.setAppStep(step: .contentViewSettings)
|
||||
}
|
||||
|
||||
private func confirmExternalNavigation() {
|
||||
guard pendingExternalNavigationAction != nil else {
|
||||
isShowLeaveLiveNavigationDialog = false
|
||||
return
|
||||
}
|
||||
isShowLeaveLiveNavigationDialog = false
|
||||
NotificationCenter.default.post(name: .requestLiveRoomQuitForExternalNavigation, object: nil)
|
||||
}
|
||||
|
||||
private func cancelExternalNavigation() {
|
||||
isShowLeaveLiveNavigationDialog = false
|
||||
pendingExternalNavigationAction = nil
|
||||
pendingExternalNavigationCancelAction?()
|
||||
pendingExternalNavigationCancelAction = nil
|
||||
}
|
||||
|
||||
private func pushTokenUpdate() {
|
||||
let pushToken = UserDefaults.string(forKey: .pushToken)
|
||||
if !pushToken.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
|
||||
Reference in New Issue
Block a user