From 9fdc18d1ec41707be3fc1f1de06b81c7f1394fb9 Mon Sep 17 00:00:00 2001 From: James Baird Date: Tue, 31 Mar 2020 12:06:04 +0100 Subject: [PATCH] welcome: hide tabs if nothing to show --- .../welcome/components/AbstractWelcomePage.js | 7 +++++++ .../welcome/components/WelcomePage.web.js | 16 +++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js index b482271c1..eb9cd3f82 100644 --- a/react/features/welcome/components/AbstractWelcomePage.js +++ b/react/features/welcome/components/AbstractWelcomePage.js @@ -7,6 +7,7 @@ import type { Dispatch } from 'redux'; import { createWelcomePageEvent, sendAnalytics } from '../../analytics'; import { appNavigate } from '../../app'; import { isCalendarEnabled } from '../../calendar-sync'; +import { isRecentListEnabled } from '../../recent-list/functions'; /** * {@code AbstractWelcomePage}'s React {@code Component} prop types. @@ -18,6 +19,11 @@ type Props = { */ _calendarEnabled: boolean, + /** + * Whether the recent list is enabled + */ + _recentListEnabled: Boolean, + /** * Room name to join to. */ @@ -239,6 +245,7 @@ export class AbstractWelcomePage extends Component { export function _mapStateToProps(state: Object) { return { _calendarEnabled: isCalendarEnabled(state), + _recentListEnabled: isRecentListEnabled(), _room: state['features/base/conference'].room, _settings: state['features/base/settings'] }; diff --git a/react/features/welcome/components/WelcomePage.web.js b/react/features/welcome/components/WelcomePage.web.js index 873b13cd9..dba5cc797 100644 --- a/react/features/welcome/components/WelcomePage.web.js +++ b/react/features/welcome/components/WelcomePage.web.js @@ -285,7 +285,7 @@ class WelcomePage extends AbstractWelcomePage { return null; } - const { _calendarEnabled, t } = this.props; + const { _calendarEnabled, _recentListEnabled, t } = this.props; const tabs = []; @@ -296,10 +296,16 @@ class WelcomePage extends AbstractWelcomePage { }); } - tabs.push({ - label: t('welcomepage.recentList'), - content: - }); + if (_recentListEnabled) { + tabs.push({ + label: t('welcomepage.recentList'), + content: + }); + } + + if (tabs.length === 0) { + return null; + } return (