Fixes loading wifi-stats when used from jitsi-meet electron utils.

This commit is contained in:
damencho 2019-07-08 11:54:54 +01:00 committed by Дамян Минков
parent f8a049759d
commit a148cd41a4
1 changed files with 16 additions and 1 deletions

View File

@ -1247,11 +1247,26 @@ export default {
}
options.applicationName = interfaceConfig.APP_NAME;
options.getWiFiStatsMethod = getJitsiMeetGlobalNS().getWiFiStats;
options.getWiFiStatsMethod = this._getWiFiStatsMethod;
return options;
},
/**
* Returns the result of getWiFiStats from the global NS or does nothing
* (returns empty result).
* Fixes a concurrency problem where we need to pass a function when creating
* JitsiConference, but that method is added to the context later.
*
* @returns {Promise}
* @private
*/
_getWiFiStatsMethod() {
const gloabalNS = getJitsiMeetGlobalNS();
return gloabalNS.getWiFiStats ? gloabalNS.getWiFiStats() : Promise.resolve('{}');
},
/**
* Start using provided video stream.
* Stops previous video stream.