瀏覽代碼

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

master
damencho 6 年之前
父節點
當前提交
a148cd41a4
共有 1 個文件被更改,包括 16 次插入1 次删除
  1. 16
    1
      conference.js

+ 16
- 1
conference.js 查看文件

1247
         }
1247
         }
1248
 
1248
 
1249
         options.applicationName = interfaceConfig.APP_NAME;
1249
         options.applicationName = interfaceConfig.APP_NAME;
1250
-        options.getWiFiStatsMethod = getJitsiMeetGlobalNS().getWiFiStats;
1250
+        options.getWiFiStatsMethod = this._getWiFiStatsMethod;
1251
 
1251
 
1252
         return options;
1252
         return options;
1253
     },
1253
     },
1254
 
1254
 
1255
+    /**
1256
+     * Returns the result of getWiFiStats from the global NS or does nothing
1257
+     * (returns empty result).
1258
+     * Fixes a concurrency problem where we need to pass a function when creating
1259
+     * JitsiConference, but that method is added to the context later.
1260
+     *
1261
+     * @returns {Promise}
1262
+     * @private
1263
+     */
1264
+    _getWiFiStatsMethod() {
1265
+        const gloabalNS = getJitsiMeetGlobalNS();
1266
+
1267
+        return gloabalNS.getWiFiStats ? gloabalNS.getWiFiStats() : Promise.resolve('{}');
1268
+    },
1269
+
1255
     /**
1270
     /**
1256
      * Start using provided video stream.
1271
      * Start using provided video stream.
1257
      * Stops previous video stream.
1272
      * Stops previous video stream.

Loading…
取消
儲存