From 393adacfa61d6500f8ad285ed136320cf713fcbd Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Thu, 14 Jan 2016 04:27:33 -0800 Subject: [PATCH] Fix WebView not to double load the URL Reviewed By: andreicoman11 Differential Revision: D2823397 fb-gh-sync-id: deb04ab22bee7022bc8bcb61fa4c24f86eddbaa8 --- .../facebook/react/views/webview/ReactWebViewManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index 6d7a883bb..bb259d65b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -286,6 +286,12 @@ public class ReactWebViewManager extends SimpleViewManager { // TODO(8495359): url and html are coupled as they both call loadUrl, therefore in case when // property url is removed in favor of property html being added in single transaction we may // end up in a state when blank url is loaded as it depends on the order of update operations! + + String currentUrl = view.getUrl(); + if (currentUrl != null && currentUrl.equals(url)) { + // We are already loading it so no need to stomp over it and start again + return; + } if (url != null) { view.loadUrl(url); } else {