From 69f8cf78361a9d48ad08c9ddec2125f922cecd68 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Fri, 26 May 2017 17:15:40 -0500 Subject: [PATCH] Fix the disabling of the Welcome page --- react/features/welcome/route.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/react/features/welcome/route.js b/react/features/welcome/route.js index 1ef260d2a..06a6f2c92 100644 --- a/react/features/welcome/route.js +++ b/react/features/welcome/route.js @@ -1,10 +1,13 @@ -/* global APP */ +/* @flow */ import { RouteRegistry } from '../base/react'; import { WelcomePage } from './components'; import { generateRoomWithoutSeparator } from './roomnameGenerator'; +declare var APP: Object; +declare var config: Object; + /** * Register route for WelcomePage. */ @@ -24,7 +27,20 @@ RouteRegistry.register({ * @returns {void} */ function onEnter(nextState, replace) { - if (typeof APP !== 'undefined' && !APP.settings.isWelcomePageEnabled()) { + // The disabling of the Welcome page by redirecting to a random room name is + // a feature (1) we have on Web/React and (2) we do not want on mobile/React + // Native (at the time of this writing). + if (typeof APP === 'object' + + // TODO Technically, there is features/base/config now so it is + // preferable to read config(uration) values from there and not rely + // on a global variable. However, the redux store is not available + // here at the time of this writing. Given the current (1) Web + // exclusivity of the feature and (2) the reliance on other global + // variables (e.g. APP), go with the global variable for now in + // order to minimize the effort involved. + && !(config.enableWelcomePage + && APP.settings.isWelcomePageEnabled())) { const room = generateRoomWithoutSeparator(); replace(`/${room}`);