fix(deeplink): 커뮤니티 댓글 딥링크를 보강한다

This commit is contained in:
Yu Sung
2026-03-13 21:39:45 +09:00
parent 3d4f67dbd5
commit de627e1700
5 changed files with 192 additions and 11 deletions

View File

@@ -50,6 +50,8 @@ class AppState: ObservableObject {
@Published var pushAudioContentId = 0
@Published var pushSeriesId = 0
@Published var pendingDeepLinkAction: AppDeepLinkAction? = nil
@Published var pendingCommunityCommentCreatorId = 0
@Published var pendingCommunityCommentPostId = 0
@Published var isPushRoomFromDeepLink = false
@Published var roomId = 0 {
didSet {
@@ -149,6 +151,35 @@ class AppState: ObservableObject {
pendingDeepLinkAction = nil
return action
}
func setPendingCommunityCommentDeepLink(creatorId: Int, postId: Int) {
guard creatorId > 0, postId > 0 else {
return
}
pendingCommunityCommentCreatorId = creatorId
pendingCommunityCommentPostId = postId
}
func consumePendingCommunityCommentPostId(creatorId: Int) -> Int? {
guard creatorId > 0 else {
return nil
}
guard pendingCommunityCommentCreatorId == creatorId,
pendingCommunityCommentPostId > 0 else {
return nil
}
let postId = pendingCommunityCommentPostId
clearPendingCommunityCommentDeepLink()
return postId
}
func clearPendingCommunityCommentDeepLink() {
pendingCommunityCommentCreatorId = 0
pendingCommunityCommentPostId = 0
}
// ( -> ) UI
func softRestart() {