From 508f2249ba3b2ce0c332c2901c299f39cddacd77 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Sat, 14 Dec 2019 11:12:33 -0500 Subject: [PATCH] fix: unauthed users Don't call preference get or wallet status (on settings page) --- ui/component/app/view.jsx | 3 ++- ui/page/settings/view.jsx | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index de6b220c3..3f90a92dd 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -169,12 +169,13 @@ function App(props: Props) { }; } }, [hasVerifiedEmail, syncEnabled, checkSync]); - + // @if TARGET='app' useEffect(() => { if (hasVerifiedEmail === false) { updatePreferences(); } }, [hasVerifiedEmail]); + // @endif useEffect(() => { if (syncError) { diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx index b39b99555..b20d6933c 100644 --- a/ui/page/settings/view.jsx +++ b/ui/page/settings/view.jsx @@ -102,12 +102,16 @@ class SettingsPage extends React.PureComponent { } componentDidMount() { - this.props.updateWalletStatus(); - getSavedPassword().then(p => { - if (p) { - this.setState({ storedPassword: true }); - } - }); + const { isAuthenticated } = this.props; + if (isAuthenticated) { + this.props.updateWalletStatus(); + + getSavedPassword().then(p => { + if (p) { + this.setState({ storedPassword: true }); + } + }); + } } onKeyFeeChange(newValue: Price) { @@ -647,7 +651,7 @@ class SettingsPage extends React.PureComponent { - {/* @endif */} + {/* @endif */} } />