Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/CommentService.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern NSUInteger const WPTopLevelHierarchicalCommentsPerPage;
- (instancetype)init NS_UNAVAILABLE;

// Create reply
- (void)createReplyForComment:(Comment *)comment content:(NSString *)content completion:(void (^)(Comment *reply))completion;
- (void)createReplyForComment:(Comment *)comment content:(NSString *)content completion:(void (^)(Comment * _Nullable reply))completion;

// Sync comments
- (void)syncCommentsForBlog:(Blog *)blog
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/CommentService.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (Comment *)createCommentForBlog:(Blog *)blog
}

// Create reply
- (void)createReplyForComment:(Comment *)comment content:(NSString *)content completion:(void (^)(Comment *reply))completion
- (void)createReplyForComment:(Comment *)comment content:(NSString *)content completion:(void (^)(Comment * _Nullable reply))completion
{
NSManagedObjectID *parentCommentID = comment.objectID;
NSManagedObjectID * __block replyID = nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,13 @@ private extension CommentDetailViewController {
return
}

try await withUnsafeThrowingContinuation { continuation in
try await withUnsafeThrowingContinuation { (continuation: UnsafeContinuation<Void, Error>) in
commentService.createReply(for: comment, content: content) { reply in
guard let reply else {
DDLogError("Failed creating comment reply: reply was nil after save")
continuation.resume(throwing: URLError(.unknown))
return
}
self.commentService.uploadComment(reply, success: { [weak self] in
self?.refreshCommentReplyIfNeeded()
continuation.resume()
Expand Down