From a85684835fd48f344fe2efa2f9f44bf231bf062a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 26 May 2020 23:56:54 -0500 Subject: [PATCH] Fix ProfilePage issues, fixes #58 --- .../features/account/components/header.js | 2 +- app/gabsocial/pages/profile_page.js | 22 ++++--------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/app/gabsocial/features/account/components/header.js b/app/gabsocial/features/account/components/header.js index 5669bc396..14c53fb92 100644 --- a/app/gabsocial/features/account/components/header.js +++ b/app/gabsocial/features/account/components/header.js @@ -72,7 +72,7 @@ class Header extends ImmutablePureComponent { username: PropTypes.string, autoPlayGif: PropTypes.bool, isStaff: PropTypes.bool.isRequired, - version: PropTypes.node, + version: PropTypes.object, }; static defaultProps = { diff --git a/app/gabsocial/pages/profile_page.js b/app/gabsocial/pages/profile_page.js index 0e9a2efa8..a06316574 100644 --- a/app/gabsocial/pages/profile_page.js +++ b/app/gabsocial/pages/profile_page.js @@ -10,8 +10,6 @@ import LinkFooter from '../features/ui/components/link_footer'; import SignUpPanel from '../features/ui/components/sign_up_panel'; import ProfileInfoPanel from '../features/ui/components/profile_info_panel'; import { acctFull } from 'gabsocial/utils/accounts'; -import { fetchAccount, fetchAccountByUsername } from '../actions/accounts'; -import { fetchAccountIdentityProofs } from '../actions/identity_proofs'; import { getFeatures } from 'gabsocial/utils/features'; const mapStateToProps = (state, { params: { username }, withReplies = false }) => { @@ -45,30 +43,18 @@ class ProfilePage extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, accountUsername: PropTypes.string.isRequired, - features: PropTypes.node, + features: PropTypes.object, }; - componentWillMount() { - const { params: { username }, accountId, me } = this.props; - - if (accountId && accountId !== -1) { - this.props.dispatch(fetchAccount(accountId)); - if (me) this.props.dispatch(fetchAccountIdentityProofs(accountId)); - } else { - this.props.dispatch(fetchAccountByUsername(username)); - } - } - render() { const { children, accountId, account, accountUsername, features } = this.props; - if (!account) return null; - const bg = account.getIn(['customizations', 'background']); + const bg = account ? account.getIn(['customizations', 'background']) : undefined; return (
- + {account && @{acctFull(account)} - + }