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.transcriptionLanguage = determineTranscriptionLanguage(options);
// Disable analytics, if requessted.
// Disable analytics, if requested.
if (options.disableThirdPartyRequests) {
delete config.analytics.scriptURLs;
delete config.analytics.amplitudeAPPKey;
delete config.analytics.googleAnalyticsTrackingId;
delete config.analytics?.scriptURLs;
delete config.analytics?.amplitudeAPPKey;
delete config.analytics?.googleAnalyticsTrackingId;
delete options.callStatsID;
delete options.callStatsSecret;
} else {

View File

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