From f4dff7e15c1f6432841db579dfbbde425f1823c6 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 79f9282c3..78bdb7904 100644 --- a/ui/component/settingSystem/view.jsx +++ b/ui/component/settingSystem/view.jsx @@ -41,6 +41,7 @@ type Props = { findingFFmpeg: boolean, walletEncrypted: boolean, isAuthenticated: boolean, + allowAnalytics: boolean, // --- perform --- setDaemonSetting: (string, ?SetDaemonSettingArg) => void, clearDaemonSetting: (string) => void, @@ -50,6 +51,7 @@ type Props = { decryptWallet: () => void, updateWalletStatus: () => void, confirmForgetPassword: ({}) => void, + toggle3PAnalytics: (boolean) => void, }; export default function SettingSystem(props: Props) { @@ -59,6 +61,7 @@ export default function SettingSystem(props: Props) { findingFFmpeg, walletEncrypted, isAuthenticated, + allowAnalytics, setDaemonSetting, clearDaemonSetting, clearCache, @@ -67,6 +70,7 @@ export default function SettingSystem(props: Props) { decryptWallet, updateWalletStatus, confirmForgetPassword, + toggle3PAnalytics, } = props; const [clearingCache, setClearingCache] = React.useState(false); @@ -165,6 +169,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)` + )}{' '} +