Browse Source

fix(android): renderError - the error status might be overwritte… (#915)

Roc 4 years ago
parent
commit
01de9e5fa0
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/WebView.android.tsx

+ 5
- 2
src/WebView.android.tsx View File

@@ -218,8 +218,11 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
218 218
     const { onLoadProgress } = this.props;
219 219
     const { nativeEvent: { progress } } = event;
220 220
     if (progress === 1) {
221
-      this.setState({
222
-        viewState: 'IDLE',
221
+      this.setState((state) => {
222
+        if (state.viewState === 'LOADING') {
223
+          return { viewState: 'IDLE' };
224
+        }
225
+        return null;
223 226
       });
224 227
     }
225 228
     if (onLoadProgress) {