fix(live): 라이브룸 전역 표시를 보정한다

This commit is contained in:
Yu Sung
2026-07-14 17:42:05 +09:00
parent dec6fb6fb8
commit 1b26bc28dd
6 changed files with 295 additions and 63 deletions

View File

@@ -38,9 +38,25 @@ class AppState: ObservableObject {
if isShowPlayer {
ContentPlayManager.shared.stopAudio()
ContentPlayerPlayManager.shared.resetPlayer()
return
}
guard let pendingExternalNavigationAction else {
return
}
self.pendingExternalNavigationAction = nil
pendingExternalNavigationCancelAction = nil
DispatchQueue.main.async {
pendingExternalNavigationAction()
}
}
}
@Published private(set) var isShowLeaveLiveNavigationDialog = false
private var pendingExternalNavigationAction: (() -> Void)?
private var pendingExternalNavigationCancelAction: (() -> Void)?
@Published var isShowNotificationSettingsDialog = false
@@ -148,6 +164,37 @@ class AppState: ObservableObject {
}
}
func requestExternalNavigation(
navigationAction: @escaping () -> Void,
cancelAction: @escaping () -> Void
) {
guard isShowPlayer else {
navigationAction()
return
}
pendingExternalNavigationAction = navigationAction
pendingExternalNavigationCancelAction = cancelAction
isShowLeaveLiveNavigationDialog = true
}
func confirmExternalNavigation() {
guard pendingExternalNavigationAction != nil else {
isShowLeaveLiveNavigationDialog = false
return
}
isShowLeaveLiveNavigationDialog = false
NotificationCenter.default.post(name: .requestLiveRoomQuitForExternalNavigation, object: nil)
}
func cancelExternalNavigation() {
isShowLeaveLiveNavigationDialog = false
pendingExternalNavigationAction = nil
pendingExternalNavigationCancelAction?()
pendingExternalNavigationCancelAction = nil
}
func consumePendingDeepLinkAction() -> AppDeepLinkAction? {
let action = pendingDeepLinkAction
pendingDeepLinkAction = nil