Merge pull request #2628 from jitsi/welcome_page_analytics

fix(analytics): Init analytics for the web welcome page.
This commit is contained in:
virtuacoplenny 2018-03-20 10:02:07 -07:00 committed by GitHub
commit 26ea667170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* global interfaceConfig */
/* global APP, config, interfaceConfig, JitsiMeetJS */
import Button from '@atlaskit/button';
import { FieldTextStateless } from '@atlaskit/field-text';
@ -6,7 +6,9 @@ import { AtlasKitThemeProvider } from '@atlaskit/theme';
import React from 'react';
import { connect } from 'react-redux';
import { initAnalytics } from '../../analytics';
import { translate } from '../../base/i18n';
import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
import { Watermarks } from '../../base/react';
import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
@ -66,6 +68,17 @@ class WelcomePage extends AbstractWelcomePage {
* @returns {void}
*/
componentDidMount() {
// FIXME: This is not the best place for this logic. Ideally we should
// use features/base/lib-jitsi-meet#initLib() action for this use case.
// But currently lib-jitsi-meet#initLib()'s logic works for mobile only
// (on web it ends up with infinite loop over initLib).
JitsiMeetJS.init({
enableAnalyticsLogging: isAnalyticsEnabled(APP.store),
...config
}).then(() => {
initAnalytics(APP.store);
});
if (this.state.generateRoomnames) {
this._updateRoomname();
}