Fix crash on group selection

This commit is contained in:
Arnaud Vergnet 2020-04-16 00:05:58 +02:00
parent ac59121609
commit c52fa3a7d8

View file

@ -261,8 +261,19 @@ class PlanexScreen extends React.Component<Props, State> {
}; };
getWebView() { getWebView() {
if (this.state.currentGroup.id !== -1) { const showWebview = this.state.currentGroup.id !== -1;
return (
return (
<View style={{height: '100%'}}>
{!showWebview
? <ErrorView
{...this.props}
icon={'account-clock'}
message={i18n.t("planexScreen.noGroupSelected")}
showRetryButton={false}
/>
: null}
<WebViewScreen <WebViewScreen
ref={this.webScreenRef} ref={this.webScreenRef}
navigation={this.props.navigation} navigation={this.props.navigation}
@ -271,16 +282,8 @@ class PlanexScreen extends React.Component<Props, State> {
onMessage={this.onMessage} onMessage={this.onMessage}
onScroll={this.onScroll} onScroll={this.onScroll}
/> />
); </View>
} else { );
return <ErrorView
{...this.props}
icon={'account-clock'}
message={i18n.t("planexScreen.noGroupSelected")}
showRetryButton={false}
/>
}
} }
render() { render() {