feat(event): 이벤트 상세 딥링크와 OneLink를 연결한다
This commit is contained in:
@@ -11,6 +11,7 @@ enum AppStep: Equatable {
|
||||
case message
|
||||
case audition
|
||||
case giftDetail(applicationNo: String)
|
||||
case eventDetail(eventId: Int)
|
||||
}
|
||||
|
||||
enum UserDefaultsKey { case userId }
|
||||
@@ -24,10 +25,22 @@ final class AppState {
|
||||
var rootStep: AppStep = .main
|
||||
var pendingDeepLinkAction: AppDeepLinkAction?
|
||||
var appliedStep: AppStep?
|
||||
var appStep: AppStep { appliedStep ?? rootStep }
|
||||
var isPushRoomFromDeepLink = false
|
||||
var pushRoomId = 0
|
||||
var pendingCommentPostId: Int?
|
||||
func setAppStep(step: AppStep) { appliedStep = step }
|
||||
func setAppStep(
|
||||
step: AppStep,
|
||||
ifCurrentStep matches: ((AppStep) -> Bool)? = nil,
|
||||
completion: @escaping () -> Void = {}
|
||||
) {
|
||||
defer { completion() }
|
||||
guard matches?(appStep) ?? true else { return }
|
||||
appliedStep = step
|
||||
}
|
||||
func requestExternalNavigation(navigationAction: @escaping () -> Void, cancelAction: @escaping () -> Void) {
|
||||
navigationAction()
|
||||
}
|
||||
func setPendingCommunityCommentDeepLink(creatorId: Int, postId: Int) { pendingCommentPostId = postId }
|
||||
func clearPendingCommunityCommentDeepLink() { pendingCommentPostId = nil }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user