Fix WebView not to double load the URL

Reviewed By: andreicoman11

Differential Revision: D2823397

fb-gh-sync-id: deb04ab22bee7022bc8bcb61fa4c24f86eddbaa8
This commit is contained in:
Dave Miller
2016-01-14 04:27:33 -08:00
committed by facebook-github-bot-5
parent 1abd12b68b
commit 393adacfa6

View File

@@ -286,6 +286,12 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
// 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 {