From 1ec7a877249c0daaa4be50aa3881d08c958337fb Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Sun, 16 Dec 2018 00:19:15 -0500 Subject: [PATCH] iOS fixes --- Web3Webview.ios.js | 6 +++--- ios/RNWeb3Webview.m | 8 +++++++- package.json | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Web3Webview.ios.js b/Web3Webview.ios.js index 056e920..b5fedf5 100644 --- a/Web3Webview.ios.js +++ b/Web3Webview.ios.js @@ -444,11 +444,11 @@ class Web3Webview extends React.Component { injectedJavaScriptForMainFrameOnly={ this.props.injectedJavaScriptForMainFrameOnly } - injectJavaScript={this.props.injectJavaScript} - injectedJavaScript={ - this.props.injectedJavaScript || + injectJavaScript={ + this.props.injectJavaScript || this.props.injectedOnStartLoadingJavaScript } + injectedJavaScript={ this.props.injectedJavaScript } bounces={this.props.bounces} scrollEnabled={this.props.scrollEnabled} contentInset={this.props.contentInset} diff --git a/ios/RNWeb3Webview.m b/ios/RNWeb3Webview.m index 41553af..e601222 100755 --- a/ios/RNWeb3Webview.m +++ b/ios/RNWeb3Webview.m @@ -307,7 +307,13 @@ - (BOOL)canGoForward - (void)reload { - [_webView reload]; + NSURLRequest *request = [RCTConvert NSURLRequest:self.source]; + if (request.URL && !_webView.URL.absoluteString.length) { + [self loadRequest:request]; + } + else { + [_webView reload]; + } } - (void)stopLoading diff --git a/package.json b/package.json index faaf1e6..2b3aea9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-web3-webview", - "version": "1.2.1", + "version": "1.2.2", "description": "A react native webview optimized for a web3 dApp browser application", "main": "index.js", "scripts": {