From 0c0448abef23aa67ce15d29b4fb6bd6c92e2a0ff Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sun, 8 Aug 2021 11:13:04 +0800 Subject: [PATCH] [System] grab "Share usage and diagnostic data" --- ui/component/settingSystem/index.js | 11 +++++- ui/component/settingSystem/view.jsx | 41 +++++++++++++++++++++++ ui/page/settings/index.js | 7 +--- ui/page/settings/view.jsx | 52 ----------------------------- 4 files changed, 52 insertions(+), 59 deletions(-) diff --git a/ui/component/settingSystem/index.js b/ui/component/settingSystem/index.js index 712a8af41..1d7cacc02 100644 --- a/ui/component/settingSystem/index.js +++ b/ui/component/settingSystem/index.js @@ -1,7 +1,14 @@ import { connect } from 'react-redux'; import { doWalletStatus, selectWalletIsEncrypted } from 'lbry-redux'; -import { doClearCache, doNotifyDecryptWallet, doNotifyEncryptWallet, doNotifyForgetPassword } from 'redux/actions/app'; +import { + doClearCache, + doNotifyDecryptWallet, + doNotifyEncryptWallet, + doNotifyForgetPassword, + doToggle3PAnalytics, +} from 'redux/actions/app'; import { doSetDaemonSetting, doClearDaemonSetting, doFindFFmpeg } from 'redux/actions/settings'; +import { selectAllowAnalytics } from 'redux/selectors/app'; import { selectDaemonSettings, selectFfmpegStatus, selectFindingFFmpeg } from 'redux/selectors/settings'; import { selectUserVerifiedEmail } from 'redux/selectors/user'; import SettingSystem from './view'; @@ -12,6 +19,7 @@ const select = (state) => ({ findingFFmpeg: selectFindingFFmpeg(state), walletEncrypted: selectWalletIsEncrypted(state), isAuthenticated: selectUserVerifiedEmail(state), + allowAnalytics: selectAllowAnalytics(state), }); const perform = (dispatch) => ({ @@ -23,6 +31,7 @@ const perform = (dispatch) => ({ decryptWallet: () => dispatch(doNotifyDecryptWallet()), updateWalletStatus: () => dispatch(doWalletStatus()), confirmForgetPassword: (modalProps) => dispatch(doNotifyForgetPassword(modalProps)), + toggle3PAnalytics: (allow) => dispatch(doToggle3PAnalytics(allow)), }); export default connect(select, perform)(SettingSystem); diff --git a/ui/component/settingSystem/view.jsx b/ui/component/settingSystem/view.jsx index c595cc1b3..68682cc04 100644 --- a/ui/component/settingSystem/view.jsx +++ b/ui/component/settingSystem/view.jsx @@ -42,6 +42,7 @@ type Props = { findingFFmpeg: boolean, walletEncrypted: boolean, isAuthenticated: boolean, + allowAnalytics: boolean, // --- perform --- setDaemonSetting: (string, ?SetDaemonSettingArg) => void, clearDaemonSetting: (string) => void, @@ -51,6 +52,7 @@ type Props = { decryptWallet: () => void, updateWalletStatus: () => void, confirmForgetPassword: ({}) => void, + toggle3PAnalytics: (boolean) => void, }; export default function SettingSystem(props: Props) { @@ -60,6 +62,7 @@ export default function SettingSystem(props: Props) { findingFFmpeg, walletEncrypted, isAuthenticated, + allowAnalytics, setDaemonSetting, clearDaemonSetting, clearCache, @@ -68,6 +71,7 @@ export default function SettingSystem(props: Props) { decryptWallet, updateWalletStatus, confirmForgetPassword, + toggle3PAnalytics, } = props; const [clearingCache, setClearingCache] = React.useState(false); @@ -166,6 +170,43 @@ export default function SettingSystem(props: Props) { {/* @endif */} + {/* @if TARGET='app' */} + + {__( + `This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you sign in to lbry.tv)` + )}{' '} +