|
|
@@ -2,7 +2,7 @@
|
|
2
|
2
|
|
|
3
|
3
|
import { setConfigFromURLParams } from '../config';
|
|
4
|
4
|
import { toState } from '../redux';
|
|
5
|
|
-import { loadScript } from '../util';
|
|
|
5
|
+import { loadScript, timeoutPromise } from '../util';
|
|
6
|
6
|
|
|
7
|
7
|
import JitsiMeetJS from './_';
|
|
8
|
8
|
|
|
|
@@ -107,9 +107,11 @@ export function isFatalJitsiConnectionError(error: Object | string) {
|
|
107
|
107
|
* Loads config.js from a specific remote server.
|
|
108
|
108
|
*
|
|
109
|
109
|
* @param {string} url - The URL to load.
|
|
|
110
|
+ * @param {number} timeoutMs - The timeout for the configuration to be loaded,
|
|
|
111
|
+ * in milliseconds.
|
|
110
|
112
|
* @returns {Promise<Object>}
|
|
111
|
113
|
*/
|
|
112
|
|
-export function loadConfig(url: string): Promise<Object> {
|
|
|
114
|
+export function loadConfig(url: string, timeoutMs: number): Promise<Object> {
|
|
113
|
115
|
let promise;
|
|
114
|
116
|
|
|
115
|
117
|
if (typeof APP === 'undefined') {
|
|
|
@@ -148,5 +150,5 @@ export function loadConfig(url: string): Promise<Object> {
|
|
148
|
150
|
return value;
|
|
149
|
151
|
});
|
|
150
|
152
|
|
|
151
|
|
- return promise;
|
|
|
153
|
+ return timeoutPromise(promise, timeoutMs);
|
|
152
|
154
|
}
|