Kaynağa Gözat

Merge pull request #2628 from jitsi/welcome_page_analytics

fix(analytics): Init analytics for the web welcome page.
master
virtuacoplenny 7 yıl önce
ebeveyn
işleme
26ea667170
No account linked to committer's email address

+ 14
- 1
react/features/welcome/components/WelcomePage.web.js Dosyayı Görüntüle

@@ -1,4 +1,4 @@
1
-/* global interfaceConfig */
1
+/* global APP, config, interfaceConfig, JitsiMeetJS */
2 2
 
3 3
 import Button from '@atlaskit/button';
4 4
 import { FieldTextStateless } from '@atlaskit/field-text';
@@ -6,7 +6,9 @@ import { AtlasKitThemeProvider } from '@atlaskit/theme';
6 6
 import React from 'react';
7 7
 import { connect } from 'react-redux';
8 8
 
9
+import { initAnalytics } from '../../analytics';
9 10
 import { translate } from '../../base/i18n';
11
+import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
10 12
 import { Watermarks } from '../../base/react';
11 13
 
12 14
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
@@ -66,6 +68,17 @@ class WelcomePage extends AbstractWelcomePage {
66 68
      * @returns {void}
67 69
      */
68 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 82
         if (this.state.generateRoomnames) {
70 83
             this._updateRoomname();
71 84
         }

Loading…
İptal
Kaydet