fix: Fixes an error with configuration without analytics.

Fixes an error `Cannot convert undefined or null to object` on load.
This commit is contained in:
Дамян Минков 2021-08-17 12:24:18 -05:00
parent 8106fb06e4
commit fbf9d489f0
2 changed files with 6 additions and 6 deletions

View File

@ -234,11 +234,11 @@ export function getConferenceOptions(stateful: Function | Object) {
options.applicationName = getName(); options.applicationName = getName();
options.transcriptionLanguage = determineTranscriptionLanguage(options); options.transcriptionLanguage = determineTranscriptionLanguage(options);
// Disable analytics, if requessted. // Disable analytics, if requested.
if (options.disableThirdPartyRequests) { if (options.disableThirdPartyRequests) {
delete config.analytics.scriptURLs; delete config.analytics?.scriptURLs;
delete config.analytics.amplitudeAPPKey; delete config.analytics?.amplitudeAPPKey;
delete config.analytics.googleAnalyticsTrackingId; delete config.analytics?.googleAnalyticsTrackingId;
delete options.callStatsID; delete options.callStatsID;
delete options.callStatsSecret; delete options.callStatsSecret;
} else { } else {

View File

@ -15,8 +15,8 @@ export * from './functions.any';
export function _cleanupConfig(config: Object) { export function _cleanupConfig(config: Object) {
config.analytics.scriptURLs = []; config.analytics.scriptURLs = [];
if (NativeModules.AppInfo.LIBRE_BUILD) { if (NativeModules.AppInfo.LIBRE_BUILD) {
delete config.analytics.amplitudeAPPKey; delete config.analytics?.amplitudeAPPKey;
delete config.analytics.googleAnalyticsTrackingId; delete config.analytics?.googleAnalyticsTrackingId;
delete config.callStatsID; delete config.callStatsID;
delete config.callStatsSecret; delete config.callStatsSecret;
} }