fix(notification): 알림 리스트 라이브 이동 분기를 보정한다

This commit is contained in:
Yu Sung
2026-03-13 15:45:39 +09:00
parent abe939e768
commit 19f5cc8ad6
3 changed files with 47 additions and 6 deletions

View File

@@ -9,8 +9,13 @@ enum AppDeepLinkAction {
case audition
}
enum AppDeepLinkSource {
case external
case notificationList
}
enum AppDeepLinkHandler {
static func handle(url: URL) -> Bool {
static func handle(url: URL, source: AppDeepLinkSource = .external) -> Bool {
guard isSupportedScheme(url) else {
return false
}
@@ -25,26 +30,30 @@ enum AppDeepLinkHandler {
return
}
apply(action: action)
apply(action: action, source: source)
}
return true
}
static func handle(urlString: String) -> Bool {
static func handle(urlString: String, source: AppDeepLinkSource = .external) -> Bool {
let trimmed = urlString.trimmingCharacters(in: .whitespacesAndNewlines)
guard let url = URL(string: trimmed) else {
return false
}
return handle(url: url)
return handle(url: url, source: source)
}
static func apply(action: AppDeepLinkAction) {
apply(action: action, source: .external)
}
private static func apply(action: AppDeepLinkAction, source: AppDeepLinkSource) {
switch action {
case .live(let roomId):
guard roomId > 0 else { return }
AppState.shared.isPushRoomFromDeepLink = true
AppState.shared.isPushRoomFromDeepLink = source == .external
AppState.shared.pushRoomId = 0
AppState.shared.pushRoomId = roomId

View File

@@ -118,7 +118,7 @@ final class PushNotificationListViewModel: ObservableObject {
return
}
_ = AppDeepLinkHandler.handle(urlString: deepLink)
_ = AppDeepLinkHandler.handle(urlString: deepLink, source: .notificationList)
}
private var requestCategory: String? {