Browse Source

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

Roc 5 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
     const { onLoadProgress } = this.props;
218
     const { onLoadProgress } = this.props;
219
     const { nativeEvent: { progress } } = event;
219
     const { nativeEvent: { progress } } = event;
220
     if (progress === 1) {
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
     if (onLoadProgress) {
228
     if (onLoadProgress) {