Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

damenchoa148cd41a4cb
diff --git a/conference.js b/conference.js
index 9d9cbd5264..12f134084b 100644
--- a/conference.js
+++ b/conference.js
@@ -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.