diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index f4bf8b18cb..2f8f1ac002 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -28,6 +28,7 @@ const GeminiScrollbar = require('react-gemini-scrollbar'); const Email = require('../../email'); const AddThreepid = require('../../AddThreepid'); const SdkConfig = require('../../SdkConfig'); +import Analytics from '../../Analytics'; import AccessibleButton from '../views/elements/AccessibleButton'; import { _t } from '../../languageHandler'; import * as languageHandler from '../../languageHandler'; @@ -55,7 +56,7 @@ const gHVersionLabel = function(repo, token='') { // Enumerate some simple 'flip a bit' UI settings (if any). // 'id' gives the key name in the im.vector.web.settings account data event // 'label' is how we describe it in the UI. -// Warning: Each "label" string below must be added to i18n/strings/en_EN.json, +// Warning: Each "label" string below must be added to i18n/strings/en_EN.json, // since they will be translated when rendered. const SETTINGS_LABELS = [ { @@ -90,7 +91,7 @@ const SETTINGS_LABELS = [ */ ]; -// Warning: Each "label" string below must be added to i18n/strings/en_EN.json, +// Warning: Each "label" string below must be added to i18n/strings/en_EN.json, // since they will be translated when rendered. const CRYPTO_SETTINGS_LABELS = [ { @@ -722,6 +723,30 @@ module.exports = React.createClass({ ); }, + _onAnalyticsOptOut: function(ev) { + UserSettingsStore.setSyncedSetting('analyticsOptOut', ev.target.checked); + Analytics[ev.target.checked ? 'disable' : 'enable'](); + }, + + _renderAnalyticsControl: function() { + return