From 62544188bdff1fd333fb5d262b2d13c877f49750 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 10 Aug 2018 14:32:10 -0500 Subject: [PATCH] feat(recording): Add analytics event and logging. --- .../Recording/StartRecordingDialogContent.web.js | 10 ++++++++++ react/features/recording/functions.js | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/react/features/recording/components/Recording/StartRecordingDialogContent.web.js b/react/features/recording/components/Recording/StartRecordingDialogContent.web.js index 9ad7f70ec9..60517df366 100644 --- a/react/features/recording/components/Recording/StartRecordingDialogContent.web.js +++ b/react/features/recording/components/Recording/StartRecordingDialogContent.web.js @@ -4,6 +4,10 @@ import Spinner from '@atlaskit/spinner'; import React, { Component } from 'react'; import { connect } from 'react-redux'; +import { + createRecordingDialogEvent, + sendAnalytics +} from '../../../analytics'; import { translate } from '../../../base/i18n'; import { authorizeDropbox, updateDropboxToken } from '../../../base/oauth'; @@ -161,6 +165,9 @@ class StartRecordingDialogContent extends Component { * @returns {void} */ _onSignInClick() { + sendAnalytics( + createRecordingDialogEvent('start', 'signIn.button') + ); this.props.dispatch(authorizeDropbox()); } @@ -172,6 +179,9 @@ class StartRecordingDialogContent extends Component { * @returns {void} */ _onSignOutClick() { + sendAnalytics( + createRecordingDialogEvent('start', 'signOut.button') + ); this.props.dispatch(updateDropboxToken()); } } diff --git a/react/features/recording/functions.js b/react/features/recording/functions.js index 8ad3f686dd..bdd1fa13ba 100644 --- a/react/features/recording/functions.js +++ b/react/features/recording/functions.js @@ -4,6 +4,8 @@ import { Dropbox } from 'dropbox'; import { JitsiRecordingConstants } from '../base/lib-jitsi-meet'; +const logger = require('jitsi-meet-logger').getLogger(__filename); + /** * Searches in the passed in redux state for an active recording session of the * passed in mode. @@ -61,5 +63,9 @@ export function getDropboxData( spaceLeft: Math.floor((allocated - used) / 1048576)// 1MiB=1048576B }; - }, () => undefined); + }, error => { + logger.error(error); + + return undefined; + }); }