Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
fix eth_sendTransaction timeout on android
Browse files Browse the repository at this point in the history
adjust request timeout on iOS
  • Loading branch information
rasom committed Feb 21, 2017
1 parent 440b78c commit b38b916
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.OkHttpClient.Builder;
import java.util.concurrent.TimeUnit;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
Expand All @@ -20,11 +22,14 @@ class StatusBridge {

private WebView webView;
private ThemedReactContext context;
private OkHttpClient client = new OkHttpClient();
private OkHttpClient client;

public StatusBridge(ThemedReactContext context, WebView webView) {
this.context = context;
this.webView = webView;
Builder b = new Builder();
b.readTimeout(310, TimeUnit.SECONDS);
client = b.build();
}

@JavascriptInterface
Expand Down
1 change: 1 addition & 0 deletions ios/RCTWKWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ - (void)sendIt:(NSString *)body
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
[request setTimeoutInterval:310];

WVURLConnection *urlConn = [WVURLConnection alloc];
[urlConn setWebView:_webView];
Expand Down

0 comments on commit b38b916

Please sign in to comment.