|
@@ -1,4 +1,5 @@
|
1
|
|
-/* global APP, $, interfaceConfig */
|
|
1
|
+/* global APP, $, interfaceConfig, config */
|
|
2
|
+
|
2
|
3
|
import React, { Component } from 'react';
|
3
|
4
|
import { connect as reactReduxConnect } from 'react-redux';
|
4
|
5
|
|
|
@@ -10,6 +11,8 @@ import ConferenceUrl from '../../../../modules/URL/ConferenceUrl';
|
10
|
11
|
import HttpConfigFetch from '../../../../modules/config/HttpConfigFetch';
|
11
|
12
|
import BoshAddressChoice from '../../../../modules/config/BoshAddressChoice';
|
12
|
13
|
|
|
14
|
+const logger = require('jitsi-meet-logger').getLogger(__filename);
|
|
15
|
+
|
13
|
16
|
/**
|
14
|
17
|
* For legacy reasons, inline style for display none.
|
15
|
18
|
* @type {{display: string}}
|
|
@@ -30,6 +33,7 @@ class Conference extends Component {
|
30
|
33
|
* @inheritdoc
|
31
|
34
|
*/
|
32
|
35
|
componentDidMount() {
|
|
36
|
+
|
33
|
37
|
/**
|
34
|
38
|
* If JWT token data it will be used for local user settings.
|
35
|
39
|
*
|
|
@@ -39,11 +43,16 @@ class Conference extends Component {
|
39
|
43
|
const localUser = APP.tokenData.caller;
|
40
|
44
|
|
41
|
45
|
if (localUser) {
|
42
|
|
- APP.settings.setEmail((localUser.getEmail() || '').trim(), true);
|
43
|
|
- APP.settings.setAvatarUrl((localUser.getAvatarUrl() || '').trim());
|
44
|
|
- APP.settings.setDisplayName((localUser.getName() || '').trim(), true);
|
|
46
|
+ const email = localUser.getEmail();
|
|
47
|
+ const avatarUrl = localUser.getAvatarUrl();
|
|
48
|
+ const name = localUser.getName();
|
|
49
|
+
|
|
50
|
+ APP.settings.setEmail((email || '').trim(), true);
|
|
51
|
+ APP.settings.setAvatarUrl((avatarUrl || '').trim());
|
|
52
|
+ APP.settings.setDisplayName((name || '').trim(), true);
|
45
|
53
|
}
|
46
|
54
|
}
|
|
55
|
+
|
47
|
56
|
/**
|
48
|
57
|
* Initialization of the app.
|
49
|
58
|
*
|
|
@@ -55,26 +64,28 @@ class Conference extends Component {
|
55
|
64
|
// Initialize the conference URL handler
|
56
|
65
|
APP.ConferenceUrl = new ConferenceUrl(window.location);
|
57
|
66
|
}
|
|
67
|
+
|
58
|
68
|
/**
|
59
|
|
- * If we have an HTTP endpoint for getting config.json configured we're going to
|
60
|
|
- * read it and override properties from config.js and interfaceConfig.js.
|
61
|
|
- * If there is no endpoint we'll just continue with initialization.
|
62
|
|
- * Keep in mind that if the endpoint has been configured and we fail to obtain
|
63
|
|
- * the config for any reason then the conference won't start and error message
|
64
|
|
- * will be displayed to the user.
|
|
69
|
+ * If we have an HTTP endpoint for getting config.json configured
|
|
70
|
+ * we're going to read it and override properties from config.js and
|
|
71
|
+ * interfaceConfig.js. If there is no endpoint we'll just
|
|
72
|
+ * continue with initialization.
|
|
73
|
+ * Keep in mind that if the endpoint has been configured and we fail
|
|
74
|
+ * to obtain the config for any reason then the conference won't
|
|
75
|
+ * start and error message will be displayed to the user.
|
65
|
76
|
*
|
66
|
77
|
* @returns {void}
|
67
|
78
|
*/
|
68
|
79
|
function obtainConfigAndInit() {
|
69
|
|
- const roomName = APP.conference.roomName;
|
|
80
|
+ const room = APP.conference.roomName;
|
70
|
81
|
|
71
|
82
|
if (config.configLocation) {
|
72
|
83
|
const configFetch = HttpConfigFetch;
|
73
|
84
|
const location = config.configLocation;
|
74
|
85
|
|
75
|
|
- configFetch.obtainConfig(location, roomName, obtainConfigHandler);
|
|
86
|
+ configFetch.obtainConfig(location, room, obtainConfigHandler);
|
76
|
87
|
} else {
|
77
|
|
- BoshAddressChoice.chooseAddress(config, roomName);
|
|
88
|
+ BoshAddressChoice.chooseAddress(config, room);
|
78
|
89
|
init();
|
79
|
90
|
}
|
80
|
91
|
}
|