Browse Source

Comments

master
Lyubo Marinov 7 years ago
parent
commit
8436f23e05

+ 11
- 3
react/features/app/actions.js View File

@@ -30,7 +30,9 @@ export function appNavigate(uri: ?string) {
30 30
  * state.
31 31
  * @param {Object} newLocation - The location URI to navigate to. The value
32 32
  * cannot be undefined and is assumed to have all properties such as
33
- * {@code host} and {@code room} defined values.
33
+ * {@code host}, {@code contextRoot}, and {@code room} defined. Depending on the
34
+ * property, it may have a value equal to {@code undefined} and that may be
35
+ * acceptable.
34 36
  * @private
35 37
  * @returns {void}
36 38
  */
@@ -55,8 +57,9 @@ function _appNavigateToMandatoryLocation(
55 57
     }
56 58
 
57 59
     /**
58
-     * Notifies that an attempt to load the config(uration) of domain has
59
-     * completed.
60
+     * Notifies that an attempt to load a config(uration) has completed. Due to
61
+     * the asynchronous native of the loading, the specified <tt>config</tt> may
62
+     * or may not be required by the time the notification arrives.
60 63
      *
61 64
      * @param {string|undefined} err - If the loading has failed, the error
62 65
      * detailing the cause of the failure.
@@ -65,6 +68,10 @@ function _appNavigateToMandatoryLocation(
65 68
      * @returns {void}
66 69
      */
67 70
     function configLoaded(err, config) {
71
+        // FIXME Due to the asynchronous native of the loading, the specified
72
+        // config may or may not be required by the time the notification
73
+        // arrives.
74
+
68 75
         if (err) {
69 76
             // XXX The failure could be, for example, because of a
70 77
             // certificate-related error. In which case the connection will
@@ -186,6 +193,7 @@ export function appWillUnmount(app) {
186 193
  *
187 194
  * @param {Object} location - The location URI which specifies the host to load
188 195
  * the config.js from.
196
+ * @private
189 197
  * @returns {Promise<Object>}
190 198
  */
191 199
 function _loadConfig(location: Object) {

+ 4
- 4
react/features/base/lib-jitsi-meet/functions.js View File

@@ -67,7 +67,7 @@ export function loadConfig(host: string, path: string = 'config.js') {
67 67
                 .then(() => {
68 68
                     const { config } = window;
69 69
 
70
-                    // We don't want to pollute global scope.
70
+                    // We don't want to pollute the global scope.
71 71
                     window.config = undefined;
72 72
 
73 73
                     if (typeof config !== 'object') {
@@ -82,9 +82,9 @@ export function loadConfig(host: string, path: string = 'config.js') {
82 82
                     throw err;
83 83
                 });
84 84
     } else {
85
-        // Return config.js file from global scope. We can't use the version
86
-        // that's being used for the React Native app because the old/current
87
-        // Web app uses config from the global scope.
85
+        // Return "the config.js file" from the global scope - that is how the
86
+        // Web app on both the client and the server was implemented before the
87
+        // React Native app was even conceived.
88 88
         promise = Promise.resolve(window.config);
89 89
     }
90 90
 

+ 3
- 5
react/features/base/util/loadScript.native.js View File

@@ -1,11 +1,10 @@
1 1
 /**
2 2
  * Loads a script from a specific URL. React Native cannot load a JS
3 3
  * file/resource/URL via a <script> HTML element, so the implementation
4
- * fetches the specified src as plain text using fetch() and then
5
- * evaluates the fetched string as JavaScript code (i.e. via the {@link eval}
6
- * function).
4
+ * fetches the specified <tt>url</tt> as plain text using {@link fetch()} and
5
+ * then evaluates the fetched string as JavaScript code (using {@link eval()}).
7 6
  *
8
- * @param {string} url - The absolute URL from the which the script is to be
7
+ * @param {string} url - The absolute URL from which the script is to be
9 8
  * (down)loaded.
10 9
  * @returns {void}
11 10
  */
@@ -20,7 +19,6 @@ export function loadScript(url) {
20 19
                 default:
21 20
                     throw response.statusText;
22 21
                 }
23
-
24 22
             })
25 23
             .then(responseText => {
26 24
                 eval.call(window, responseText); // eslint-disable-line no-eval

Loading…
Cancel
Save