fix(deeplink): 커뮤니티 댓글 딥링크를 보강한다
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user