From fda2548a384a62a125035e3a2bcf0c5688b35bfb Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 19 Mar 2018 17:51:22 -0500 Subject: [PATCH] fix(analytics): Init analytics for the web welcome page. --- .../welcome/components/WelcomePage.web.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/react/features/welcome/components/WelcomePage.web.js b/react/features/welcome/components/WelcomePage.web.js index de3d2abc9..3feeb20bc 100644 --- a/react/features/welcome/components/WelcomePage.web.js +++ b/react/features/welcome/components/WelcomePage.web.js @@ -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(); }