Fix glitched out "not found" message for non-existing profiles in web UI (#10517)

This commit is contained in:
Eugen Rochko
2019-04-09 05:02:48 +02:00
committed by GitHub
parent ba1a78d168
commit 56f29c38b6
6 changed files with 54 additions and 6 deletions

View File

@ -16,8 +16,10 @@ import Column from '../ui/components/column';
import HeaderContainer from '../account_timeline/containers/header_container';
import ColumnBackButton from '../../components/column_back_button';
import ScrollableList from '../../components/scrollable_list';
import MissingIndicator from 'mastodon/components/missing_indicator';
const mapStateToProps = (state, props) => ({
isAccount: !!state.getIn(['accounts', props.params.accountId]),
accountIds: state.getIn(['user_lists', 'followers', props.params.accountId, 'items']),
hasMore: !!state.getIn(['user_lists', 'followers', props.params.accountId, 'next']),
blockedBy: state.getIn(['relationships', props.params.accountId, 'blocked_by'], false),
@ -33,6 +35,7 @@ class Followers extends ImmutablePureComponent {
accountIds: ImmutablePropTypes.list,
hasMore: PropTypes.bool,
blockedBy: PropTypes.bool,
isAccount: PropTypes.bool,
};
componentWillMount () {
@ -52,7 +55,15 @@ class Followers extends ImmutablePureComponent {
}, 300, { leading: true });
render () {
const { shouldUpdateScroll, accountIds, hasMore, blockedBy } = this.props;
const { shouldUpdateScroll, accountIds, hasMore, blockedBy, isAccount } = this.props;
if (!isAccount) {
return (
<Column>
<MissingIndicator />
</Column>
);
}
if (!accountIds) {
return (