Browse Source

Merge pull request #1174 from jitsi/fix-disabled-welcome-page

Fix disabled Welcome page broken with the introduction of React
master
Дамян Минков 8 years ago
parent
commit
e8c631de01
2 changed files with 30 additions and 18 deletions
  1. 12
    11
      app.js
  2. 18
    7
      react/features/welcome/components/WelcomePage.web.js

+ 12
- 11
app.js View File

@@ -192,9 +192,18 @@ function init() {
192 192
     APP.ConferenceUrl = new ConferenceUrl(window.location);
193 193
     // Clean up the URL displayed by the browser
194 194
     replaceHistoryState(APP.ConferenceUrl.getInviteUrl());
195
+
196
+    // TODO The execution of the mobile app starts from react/index.native.js.
197
+    // Similarly, the execution of the Web app should start from
198
+    // react/index.web.js for the sake of consistency and ease of understanding.
199
+    // Temporarily though because we are at the beginning of introducing React
200
+    // into the Web app, allow the execution of the Web app to start from app.js
201
+    // in order to reduce the complexity of the beginning step.
202
+    require('./react');
203
+
195 204
     const isUIReady = APP.UI.start();
196 205
     if (isUIReady) {
197
-        APP.conference.init({roomName: buildRoomName()}).then(function () {
206
+        APP.conference.init({roomName: buildRoomName()}).then(() => {
198 207
 
199 208
             if (APP.logCollector) {
200 209
                 // Start the LogCollector's periodic "store logs" task only if
@@ -227,13 +236,13 @@ function init() {
227 236
 
228 237
             APP.UI.initConference();
229 238
 
230
-            APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
239
+            APP.UI.addListener(UIEvents.LANG_CHANGED, language => {
231 240
                 APP.translation.setLanguage(language);
232 241
                 APP.settings.setLanguage(language);
233 242
             });
234 243
 
235 244
             APP.keyboardshortcut.init();
236
-        }).catch(function (err) {
245
+        }).catch(err => {
237 246
             APP.UI.hideRingOverLay();
238 247
             APP.API.notifyConferenceLeft(APP.conference.roomName);
239 248
             logger.error(err);
@@ -284,14 +293,6 @@ $(document).ready(function () {
284 293
 
285 294
     URLProcessor.setConfigParametersFromUrl();
286 295
 
287
-    // TODO The execution of the mobile app starts from react/index.native.js.
288
-    // Similarly, the execution of the Web app should start from
289
-    // react/index.web.js for the sake of consistency and ease of understanding.
290
-    // Temporarily though because we are at the beginning of introducing React
291
-    // into the Web app, allow the execution of the Web app to start from app.js
292
-    // in order to reduce the complexity of the beginning step.
293
-    require('./react');
294
-
295 296
     APP.init();
296 297
 
297 298
     APP.translation.init(settings.getLanguage());

+ 18
- 7
react/features/welcome/components/WelcomePage.web.js View File

@@ -1,5 +1,7 @@
1 1
 import React, { Component } from 'react';
2 2
 
3
+import { Conference } from '../../conference';
4
+
3 5
 /**
4 6
  * The web container rendering the welcome page.
5 7
  */
@@ -12,14 +14,23 @@ export default class WelcomePage extends Component {
12 14
      * @returns {ReactElement|null}
13 15
      */
14 16
     render() {
17
+        // FIXME The rendering of Conference bellow is a very quick and dirty
18
+        // temporary fix for the following issue: when the WelcomePage is
19
+        // disabled, app.js expects Conference to be rendered already and only
20
+        // then it builds a room name but the App component expects the room
21
+        // name to be built already (by looking at the window's location) in
22
+        // order to choose between WelcomePage and Conference.
15 23
         return (
16
-            <div id = 'welcome_page'>
17
-                {
18
-                    this._renderHeader()
19
-                }
20
-                {
21
-                    this._renderMain()
22
-                }
24
+            <div>
25
+                <div id = 'welcome_page'>
26
+                    {
27
+                        this._renderHeader()
28
+                    }
29
+                    {
30
+                        this._renderMain()
31
+                    }
32
+                </div>
33
+                <Conference />
23 34
             </div>
24 35
         );
25 36
     }

Loading…
Cancel
Save