Browse Source

Merge pull request #2628 from jitsi/welcome_page_analytics

fix(analytics): Init analytics for the web welcome page.
master
virtuacoplenny 7 years ago
parent
commit
26ea667170
No account linked to committer's email address
1 changed files with 14 additions and 1 deletions
  1. 14
    1
      react/features/welcome/components/WelcomePage.web.js

+ 14
- 1
react/features/welcome/components/WelcomePage.web.js View File

1
-/* global interfaceConfig */
1
+/* global APP, config, interfaceConfig, JitsiMeetJS */
2
 
2
 
3
 import Button from '@atlaskit/button';
3
 import Button from '@atlaskit/button';
4
 import { FieldTextStateless } from '@atlaskit/field-text';
4
 import { FieldTextStateless } from '@atlaskit/field-text';
6
 import React from 'react';
6
 import React from 'react';
7
 import { connect } from 'react-redux';
7
 import { connect } from 'react-redux';
8
 
8
 
9
+import { initAnalytics } from '../../analytics';
9
 import { translate } from '../../base/i18n';
10
 import { translate } from '../../base/i18n';
11
+import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
10
 import { Watermarks } from '../../base/react';
12
 import { Watermarks } from '../../base/react';
11
 
13
 
12
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
14
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
66
      * @returns {void}
68
      * @returns {void}
67
      */
69
      */
68
     componentDidMount() {
70
     componentDidMount() {
71
+        // FIXME: This is not the best place for this logic. Ideally we should
72
+        // use features/base/lib-jitsi-meet#initLib() action for this use case.
73
+        // But currently lib-jitsi-meet#initLib()'s logic works for mobile only
74
+        // (on web it ends up with infinite loop over initLib).
75
+        JitsiMeetJS.init({
76
+            enableAnalyticsLogging: isAnalyticsEnabled(APP.store),
77
+            ...config
78
+        }).then(() => {
79
+            initAnalytics(APP.store);
80
+        });
81
+
69
         if (this.state.generateRoomnames) {
82
         if (this.state.generateRoomnames) {
70
             this._updateRoomname();
83
             this._updateRoomname();
71
         }
84
         }

Loading…
Cancel
Save