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

This commit is contained in:
Roc 2019-09-29 21:40:12 +08:00 committed by Thibault Malbranche
parent f958f8a493
commit 01de9e5fa0
1 changed files with 5 additions and 2 deletions

View File

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