콘텐츠 댓글 수정 오류
- 댓글 수정 모드 상태에서 다른 댓글 쓰기 혹은 삭제 등의 액션을 해서 댓글 수의 변화가 있을 때 내 글이 아닌 다른 사람의 글이 수정 모드로 보이는 버그 수정
This commit is contained in:
@@ -13,6 +13,7 @@ final class AudioContentListReplyViewModel: ObservableObject {
|
||||
private let repository = ContentRepository()
|
||||
private var subscription = Set<AnyCancellable>()
|
||||
|
||||
@Published var isRegisterComment = false
|
||||
@Published var isLoading = false
|
||||
@Published var errorMessage = ""
|
||||
@Published var isShowPopup = false
|
||||
@@ -83,6 +84,7 @@ final class AudioContentListReplyViewModel: ObservableObject {
|
||||
}
|
||||
|
||||
isLoading = true
|
||||
isRegisterComment = true
|
||||
|
||||
repository.registerComment(audioContentId: audioContentId, comment: comment, parentId: commentId)
|
||||
.sink { result in
|
||||
@@ -94,6 +96,7 @@ final class AudioContentListReplyViewModel: ObservableObject {
|
||||
}
|
||||
} receiveValue: { [unowned self] response in
|
||||
self.isLoading = false
|
||||
self.isRegisterComment = false
|
||||
let responseData = response.data
|
||||
|
||||
do {
|
||||
@@ -101,6 +104,7 @@ final class AudioContentListReplyViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||
|
||||
if decoded.success {
|
||||
self.commentList.removeAll()
|
||||
self.comment = ""
|
||||
self.page = 1
|
||||
self.isLast = false
|
||||
|
||||
Reference in New Issue
Block a user