forked from vergnet/application-amicale
Fix crash on group selection
This commit is contained in:
parent
ac59121609
commit
c52fa3a7d8
1 changed files with 15 additions and 12 deletions
|
@ -261,8 +261,19 @@ class PlanexScreen extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
getWebView() {
|
||||
if (this.state.currentGroup.id !== -1) {
|
||||
return (
|
||||
const showWebview = this.state.currentGroup.id !== -1;
|
||||
|
||||
return (
|
||||
<View style={{height: '100%'}}>
|
||||
{!showWebview
|
||||
? <ErrorView
|
||||
{...this.props}
|
||||
icon={'account-clock'}
|
||||
message={i18n.t("planexScreen.noGroupSelected")}
|
||||
showRetryButton={false}
|
||||
/>
|
||||
: null}
|
||||
|
||||
<WebViewScreen
|
||||
ref={this.webScreenRef}
|
||||
navigation={this.props.navigation}
|
||||
|
@ -271,16 +282,8 @@ class PlanexScreen extends React.Component<Props, State> {
|
|||
onMessage={this.onMessage}
|
||||
onScroll={this.onScroll}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return <ErrorView
|
||||
{...this.props}
|
||||
icon={'account-clock'}
|
||||
message={i18n.t("planexScreen.noGroupSelected")}
|
||||
showRetryButton={false}
|
||||
/>
|
||||
}
|
||||
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue