Skip to content

Commit

Permalink
Fix proptype warning for WebviewError (#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickycodes authored Oct 6, 2020
1 parent 78f9150 commit 15aae28
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/components/UI/WebviewError/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,24 @@ export default class WebviewError extends PureComponent {
/**
* error info
*/
error: PropTypes.object,
error: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
/**
* Function that reloads the page
*/
onReload: PropTypes.func
};

static defaultProps = {
error: false
};

onReload = () => {
this.props.onReload();
};

render() {
const { error } = this.props;
if (!error) {
return null;
}
return (
return error ? (
<View style={styles.wrapper}>
<View style={styles.foxWrapper}>
{Device.isAndroid() ? (
Expand All @@ -104,6 +105,6 @@ export default class WebviewError extends PureComponent {
</StyledButton>
</View>
</View>
);
) : null;
}
}

0 comments on commit 15aae28

Please sign in to comment.