Browse Source

Fix crash on group selection

Arnaud Vergnet 4 years ago
parent
commit
c52fa3a7d8
1 changed files with 15 additions and 12 deletions
  1. 15
    12
      src/screens/Websites/PlanexScreen.js

+ 15
- 12
src/screens/Websites/PlanexScreen.js View File

@@ -261,8 +261,19 @@ class PlanexScreen extends React.Component<Props, State> {
261 261
     };
262 262
 
263 263
     getWebView() {
264
-        if (this.state.currentGroup.id !== -1) {
265
-            return (
264
+        const showWebview = this.state.currentGroup.id !== -1;
265
+
266
+        return (
267
+            <View style={{height: '100%'}}>
268
+                {!showWebview
269
+                    ? <ErrorView
270
+                        {...this.props}
271
+                        icon={'account-clock'}
272
+                        message={i18n.t("planexScreen.noGroupSelected")}
273
+                        showRetryButton={false}
274
+                    />
275
+                    : null}
276
+
266 277
                 <WebViewScreen
267 278
                     ref={this.webScreenRef}
268 279
                     navigation={this.props.navigation}
@@ -271,16 +282,8 @@ class PlanexScreen extends React.Component<Props, State> {
271 282
                     onMessage={this.onMessage}
272 283
                     onScroll={this.onScroll}
273 284
                 />
274
-            );
275
-        } else {
276
-            return <ErrorView
277
-                {...this.props}
278
-                icon={'account-clock'}
279
-                message={i18n.t("planexScreen.noGroupSelected")}
280
-                showRetryButton={false}
281
-            />
282
-        }
283
-
285
+            </View>
286
+        );
284 287
     }
285 288
 
286 289
     render() {

Loading…
Cancel
Save