Browse Source

welcome: hide tabs if nothing to show

j8
James Baird 5 years ago
parent
commit
9fdc18d1ec
No account linked to committer's email address

+ 7
- 0
react/features/welcome/components/AbstractWelcomePage.js View File

@@ -7,6 +7,7 @@ import type { Dispatch } from 'redux';
7 7
 import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
8 8
 import { appNavigate } from '../../app';
9 9
 import { isCalendarEnabled } from '../../calendar-sync';
10
+import { isRecentListEnabled } from '../../recent-list/functions';
10 11
 
11 12
 /**
12 13
  * {@code AbstractWelcomePage}'s React {@code Component} prop types.
@@ -18,6 +19,11 @@ type Props = {
18 19
      */
19 20
     _calendarEnabled: boolean,
20 21
 
22
+    /**
23
+     * Whether the recent list is enabled
24
+     */
25
+    _recentListEnabled: Boolean,
26
+
21 27
     /**
22 28
      * Room name to join to.
23 29
      */
@@ -239,6 +245,7 @@ export class AbstractWelcomePage extends Component<Props, *> {
239 245
 export function _mapStateToProps(state: Object) {
240 246
     return {
241 247
         _calendarEnabled: isCalendarEnabled(state),
248
+        _recentListEnabled: isRecentListEnabled(),
242 249
         _room: state['features/base/conference'].room,
243 250
         _settings: state['features/base/settings']
244 251
     };

+ 11
- 5
react/features/welcome/components/WelcomePage.web.js View File

@@ -285,7 +285,7 @@ class WelcomePage extends AbstractWelcomePage {
285 285
             return null;
286 286
         }
287 287
 
288
-        const { _calendarEnabled, t } = this.props;
288
+        const { _calendarEnabled, _recentListEnabled, t } = this.props;
289 289
 
290 290
         const tabs = [];
291 291
 
@@ -296,10 +296,16 @@ class WelcomePage extends AbstractWelcomePage {
296 296
             });
297 297
         }
298 298
 
299
-        tabs.push({
300
-            label: t('welcomepage.recentList'),
301
-            content: <RecentList />
302
-        });
299
+        if (_recentListEnabled) {
300
+            tabs.push({
301
+                label: t('welcomepage.recentList'),
302
+                content: <RecentList />
303
+            });
304
+        }
305
+
306
+        if (tabs.length === 0) {
307
+            return null;
308
+        }
303 309
 
304 310
         return (
305 311
             <Tabs

Loading…
Cancel
Save