Bladeren bron

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

Fix disabled Welcome page broken with the introduction of React
master
Дамян Минков 9 jaren geleden
bovenliggende
commit
e8c631de01
2 gewijzigde bestanden met toevoegingen van 30 en 18 verwijderingen
  1. 12
    11
      app.js
  2. 18
    7
      react/features/welcome/components/WelcomePage.web.js

+ 12
- 11
app.js Bestand weergeven

192
     APP.ConferenceUrl = new ConferenceUrl(window.location);
192
     APP.ConferenceUrl = new ConferenceUrl(window.location);
193
     // Clean up the URL displayed by the browser
193
     // Clean up the URL displayed by the browser
194
     replaceHistoryState(APP.ConferenceUrl.getInviteUrl());
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
     const isUIReady = APP.UI.start();
204
     const isUIReady = APP.UI.start();
196
     if (isUIReady) {
205
     if (isUIReady) {
197
-        APP.conference.init({roomName: buildRoomName()}).then(function () {
206
+        APP.conference.init({roomName: buildRoomName()}).then(() => {
198
 
207
 
199
             if (APP.logCollector) {
208
             if (APP.logCollector) {
200
                 // Start the LogCollector's periodic "store logs" task only if
209
                 // Start the LogCollector's periodic "store logs" task only if
227
 
236
 
228
             APP.UI.initConference();
237
             APP.UI.initConference();
229
 
238
 
230
-            APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
239
+            APP.UI.addListener(UIEvents.LANG_CHANGED, language => {
231
                 APP.translation.setLanguage(language);
240
                 APP.translation.setLanguage(language);
232
                 APP.settings.setLanguage(language);
241
                 APP.settings.setLanguage(language);
233
             });
242
             });
234
 
243
 
235
             APP.keyboardshortcut.init();
244
             APP.keyboardshortcut.init();
236
-        }).catch(function (err) {
245
+        }).catch(err => {
237
             APP.UI.hideRingOverLay();
246
             APP.UI.hideRingOverLay();
238
             APP.API.notifyConferenceLeft(APP.conference.roomName);
247
             APP.API.notifyConferenceLeft(APP.conference.roomName);
239
             logger.error(err);
248
             logger.error(err);
284
 
293
 
285
     URLProcessor.setConfigParametersFromUrl();
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
     APP.init();
296
     APP.init();
296
 
297
 
297
     APP.translation.init(settings.getLanguage());
298
     APP.translation.init(settings.getLanguage());

+ 18
- 7
react/features/welcome/components/WelcomePage.web.js Bestand weergeven

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 
2
 
3
+import { Conference } from '../../conference';
4
+
3
 /**
5
 /**
4
  * The web container rendering the welcome page.
6
  * The web container rendering the welcome page.
5
  */
7
  */
12
      * @returns {ReactElement|null}
14
      * @returns {ReactElement|null}
13
      */
15
      */
14
     render() {
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
         return (
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
             </div>
34
             </div>
24
         );
35
         );
25
     }
36
     }

Laden…
Annuleren
Opslaan