Skip to content

Commit a1b4f8c

Browse files
authored
Merge pull request #38 from MetaMask/fix/webview-ios-issue
fix webvios ios
2 parents a7e2ea6 + 75b78c0 commit a1b4f8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apple/RNCWebViewImpl.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,12 +1356,12 @@ - (void) webView:(WKWebView *)webView
13561356
decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
13571357
{
13581358
WKNavigationResponsePolicy policy = WKNavigationResponsePolicyAllow;
1359-
if (_onHttpError && navigationResponse.forMainFrame) {
1359+
if (_onHttpError) {
13601360
if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) {
13611361
NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response;
13621362
NSInteger statusCode = response.statusCode;
13631363

1364-
if (statusCode >= 400) {
1364+
if (statusCode >= 400 && navigationResponse.forMainFrame) {
13651365
NSMutableDictionary<NSString *, id> *httpErrorEvent = [self baseEvent];
13661366
[httpErrorEvent addEntriesFromDictionary: @{
13671367
@"url": response.URL.absoluteString,

0 commit comments

Comments
 (0)