Преглед изворни кода

Remove first load variable

Salvatore Randazzo пре 4 година
родитељ
комит
f79d4e9262

+ 2
- 6
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java Прегледај датотеку

@@ -707,7 +707,6 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
707 707
   protected static class RNCWebViewClient extends WebViewClient {
708 708
 
709 709
     protected boolean mLastLoadFailed = false;
710
-    protected boolean mIsFirstLoad = true;
711 710
     protected @Nullable
712 711
     ReadableArray mUrlPrefixesForDefaultIntent;
713 712
 
@@ -729,11 +728,8 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
729 728
       super.onPageStarted(webView, url, favicon);
730 729
       mLastLoadFailed = false;
731 730
 
732
-      if (mIsFirstLoad) {
733
-        RNCWebView reactWebView = (RNCWebView) webView;
734
-        reactWebView.callInjectedJavaScriptBeforeContentLoaded();  
735
-      }
736
-      mIsFirstLoad = false;      
731
+      RNCWebView reactWebView = (RNCWebView) webView;
732
+      reactWebView.callInjectedJavaScriptBeforeContentLoaded();       
737 733
 
738 734
       dispatchEvent(
739 735
         webView,