|
|
@ -13,6 +13,7 @@ import { List as ImmutableList } from 'immutable';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { fetchAccountIdentityProofs } from '../../actions/identity_proofs';
|
|
|
|
import { fetchAccountIdentityProofs } from '../../actions/identity_proofs';
|
|
|
|
|
|
|
|
import MissingIndicator from 'mastodon/components/missing_indicator';
|
|
|
|
|
|
|
|
|
|
|
|
const emptyList = ImmutableList();
|
|
|
|
const emptyList = ImmutableList();
|
|
|
|
|
|
|
|
|
|
|
@ -20,6 +21,7 @@ const mapStateToProps = (state, { params: { accountId }, withReplies = false })
|
|
|
|
const path = withReplies ? `${accountId}:with_replies` : accountId;
|
|
|
|
const path = withReplies ? `${accountId}:with_replies` : accountId;
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
isAccount: !!state.getIn(['accounts', accountId]),
|
|
|
|
statusIds: state.getIn(['timelines', `account:${path}`, 'items'], emptyList),
|
|
|
|
statusIds: state.getIn(['timelines', `account:${path}`, 'items'], emptyList),
|
|
|
|
featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], emptyList),
|
|
|
|
featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], emptyList),
|
|
|
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
|
|
|
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
|
|
|
@ -41,6 +43,7 @@ class AccountTimeline extends ImmutablePureComponent {
|
|
|
|
hasMore: PropTypes.bool,
|
|
|
|
hasMore: PropTypes.bool,
|
|
|
|
withReplies: PropTypes.bool,
|
|
|
|
withReplies: PropTypes.bool,
|
|
|
|
blockedBy: PropTypes.bool,
|
|
|
|
blockedBy: PropTypes.bool,
|
|
|
|
|
|
|
|
isAccount: PropTypes.bool,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount () {
|
|
|
|
componentWillMount () {
|
|
|
@ -74,7 +77,15 @@ class AccountTimeline extends ImmutablePureComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
const { shouldUpdateScroll, statusIds, featuredStatusIds, isLoading, hasMore, blockedBy } = this.props;
|
|
|
|
const { shouldUpdateScroll, statusIds, featuredStatusIds, isLoading, hasMore, blockedBy, isAccount } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isAccount) {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Column>
|
|
|
|
|
|
|
|
<MissingIndicator />
|
|
|
|
|
|
|
|
</Column>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!statusIds && isLoading) {
|
|
|
|
if (!statusIds && isLoading) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|