From 92e19501949bac3825c23087e0aeba3109ea12d0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 9 Apr 2019 05:02:48 +0200 Subject: [Glitch] Fix glitched out "not found" message for non-existing profiles in web UI Port 56f29c38b603a98e7b9715c48de022106d8da073 to glitch-soc --- .../glitch/features/account_timeline/components/header.js | 3 +-- .../flavours/glitch/features/account_timeline/index.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours/glitch/features/account_timeline') diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.js b/app/javascript/flavours/glitch/features/account_timeline/components/header.js index 96cabe847..0faa8a424 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.js @@ -3,7 +3,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import InnerHeader from 'flavours/glitch/features/account/components/header'; import ActionBar from 'flavours/glitch/features/account/components/action_bar'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { FormattedMessage } from 'react-intl'; import { NavLink } from 'react-router-dom'; @@ -89,7 +88,7 @@ export default class Header extends ImmutablePureComponent { const { account, hideTabs, identity_proofs } = this.props; if (account === null) { - return ; + return null; } return ( diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.js b/app/javascript/flavours/glitch/features/account_timeline/index.js index 9971c0f4a..93d8fc9ec 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.js +++ b/app/javascript/flavours/glitch/features/account_timeline/index.js @@ -13,11 +13,13 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { FormattedMessage } from 'react-intl'; import { fetchAccountIdentityProofs } from '../../actions/identity_proofs'; +import MissingIndicator from 'flavours/glitch/components/missing_indicator'; const mapStateToProps = (state, { params: { accountId }, withReplies = false }) => { const path = withReplies ? `${accountId}:with_replies` : accountId; return { + isAccount: !!state.getIn(['accounts', accountId]), statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()), featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']), @@ -36,6 +38,7 @@ export default class AccountTimeline extends ImmutablePureComponent { isLoading: PropTypes.bool, hasMore: PropTypes.bool, withReplies: PropTypes.bool, + isAccount: PropTypes.bool, }; componentWillMount () { @@ -73,7 +76,15 @@ export default class AccountTimeline extends ImmutablePureComponent { } render () { - const { statusIds, featuredStatusIds, isLoading, hasMore } = this.props; + const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount } = this.props; + + if (!isAccount) { + return ( + + + + ); + } if (!statusIds && isLoading) { return ( -- cgit