Browse Source

Fix the disabling of the Welcome page

master
Lyubo Marinov 8 years ago
parent
commit
69f8cf7836
1 changed files with 18 additions and 2 deletions
  1. 18
    2
      react/features/welcome/route.js

+ 18
- 2
react/features/welcome/route.js View File

1
-/* global APP */
1
+/* @flow */
2
 
2
 
3
 import { RouteRegistry } from '../base/react';
3
 import { RouteRegistry } from '../base/react';
4
 
4
 
5
 import { WelcomePage } from './components';
5
 import { WelcomePage } from './components';
6
 import { generateRoomWithoutSeparator } from './roomnameGenerator';
6
 import { generateRoomWithoutSeparator } from './roomnameGenerator';
7
 
7
 
8
+declare var APP: Object;
9
+declare var config: Object;
10
+
8
 /**
11
 /**
9
  * Register route for WelcomePage.
12
  * Register route for WelcomePage.
10
  */
13
  */
24
  * @returns {void}
27
  * @returns {void}
25
  */
28
  */
26
 function onEnter(nextState, replace) {
29
 function onEnter(nextState, replace) {
27
-    if (typeof APP !== 'undefined' && !APP.settings.isWelcomePageEnabled()) {
30
+    // The disabling of the Welcome page by redirecting to a random room name is
31
+    // a feature (1) we have on Web/React and (2) we do not want on mobile/React
32
+    // Native (at the time of this writing).
33
+    if (typeof APP === 'object'
34
+
35
+            // TODO Technically, there is features/base/config now so it is
36
+            // preferable to read config(uration) values from there and not rely
37
+            // on a global variable. However, the redux store is not available
38
+            // here at the time of this writing. Given the current (1) Web
39
+            // exclusivity of the feature and (2) the reliance on other global
40
+            // variables (e.g. APP), go with the global variable for now in
41
+            // order to minimize the effort involved.
42
+            && !(config.enableWelcomePage
43
+                && APP.settings.isWelcomePageEnabled())) {
28
         const room = generateRoomWithoutSeparator();
44
         const room = generateRoomWithoutSeparator();
29
 
45
 
30
         replace(`/${room}`);
46
         replace(`/${room}`);

Loading…
Cancel
Save