Преглед на файлове

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

Roc преди 5 години
родител
ревизия
01de9e5fa0
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5
    2
      src/WebView.android.tsx

+ 5
- 2
src/WebView.android.tsx Целия файл

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) {