diff --git a/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentItemView.swift b/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentItemView.swift index 2f06823..0efb224 100644 --- a/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentItemView.swift +++ b/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentItemView.swift @@ -120,11 +120,11 @@ struct AudioContentCommentItemView: View { .frame(width: 35, height: 35) .padding(6.7) .onTapGesture { + isModeModify = false hideKeyboard() if commentItem.comment != comment { modifyComment(commentItem.id, comment) } - isModeModify = false } } .background(Color.gray23) @@ -188,6 +188,7 @@ struct AudioContentCommentItemView: View { .font(.custom(Font.medium.rawValue, size: 14)) .foregroundColor(Color.gray77) .onTapGesture { + isModeModify = false onClickDelete(commentItem.id) isShowPopupMenu = false } diff --git a/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentListView.swift b/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentListView.swift index 0ba52ec..bb1a53c 100644 --- a/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentListView.swift +++ b/SodaLive/Sources/Content/Detail/Comment/AudioContentCommentListView.swift @@ -78,11 +78,11 @@ struct AudioContentCommentListView: View { HStack(spacing: 8) { KFImage(URL(string: UserDefaults.string(forKey: .profileImage))) - .cancelOnDisappear(true) - .downsampling(size: CGSize(width: 33.3, height: 33.3)) - .resizable() - .frame(width: 33.3, height: 33.3) - .clipShape(Circle()) + .cancelOnDisappear(true) + .downsampling(size: CGSize(width: 33.3, height: 33.3)) + .resizable() + .frame(width: 33.3, height: 33.3) + .clipShape(Circle()) HStack(spacing: 0) { TextField("댓글을 입력해 보세요.", text: $viewModel.comment) @@ -122,11 +122,11 @@ struct AudioContentCommentListView: View { .padding(.bottom, 13.3) .padding(.horizontal, 13.3) - ScrollView(.vertical, showsIndicators: false) { - LazyVStack(spacing: 13.3) { - ForEach(0..() + @Published var isRegisterComment = false @Published var isLoading = false @Published var errorMessage = "" @Published var isShowPopup = false @@ -85,6 +86,7 @@ class AudioContentCommentListViewModel: ObservableObject { } isLoading = true + isRegisterComment = true repository.registerComment(audioContentId: audioContentId, comment: comment, isSecret: isSecret) .sink { result in @@ -96,6 +98,7 @@ class AudioContentCommentListViewModel: ObservableObject { } } receiveValue: { [unowned self] response in self.isLoading = false + self.isRegisterComment = false let responseData = response.data do { @@ -103,6 +106,7 @@ class AudioContentCommentListViewModel: ObservableObject { let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData) if decoded.success { + self.commentList.removeAll() self.comment = "" self.page = 1 self.isLast = false diff --git a/SodaLive/Sources/Content/Detail/Comment/AudioContentListReplyView.swift b/SodaLive/Sources/Content/Detail/Comment/AudioContentListReplyView.swift index d6abf5e..8ba8105 100644 --- a/SodaLive/Sources/Content/Detail/Comment/AudioContentListReplyView.swift +++ b/SodaLive/Sources/Content/Detail/Comment/AudioContentListReplyView.swift @@ -110,35 +110,37 @@ struct AudioContentListReplyView: View { .padding(.horizontal, 26.7) .padding(.bottom, 13.3) - ScrollView(.vertical, showsIndicators: false) { - LazyVStack(spacing: 13.3) { - ForEach(0..() + @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