Skip to content

Commit

Permalink
Merge pull request #20642 from wordpress-mobile/fix/20641-fetchPostANR
Browse files Browse the repository at this point in the history
Prevents ANR when fetching reader post
  • Loading branch information
jarvislin authored Apr 17, 2024
2 parents 2f077fa + 50b239d commit bccc12a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ private static void requestPost(RestClientUtils restClientUtils, String path, fi
@Override
public void onResponse(JSONObject jsonObject) {
ReaderPost post = ReaderPost.fromJson(jsonObject);
ReaderPostTable.addPost(post);
handlePostLikes(post, jsonObject);
new Thread(() -> {
ReaderPostTable.addPost(post);
handlePostLikes(post, jsonObject);
}).start();
if (requestListener != null) {
requestListener.onSuccess(post.getBlogUrl());
}
Expand Down

0 comments on commit bccc12a

Please sign in to comment.