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