|
@ -13,11 +13,13 @@ 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 'flavours/glitch/components/missing_indicator'; |
|
|
|
|
|
|
|
|
const mapStateToProps = (state, { params: { accountId }, withReplies = false }) => { |
|
|
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'], ImmutableList()), |
|
|
statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()), |
|
|
featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), |
|
|
featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), |
|
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']), |
|
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']), |
|
@ -36,6 +38,7 @@ export default class AccountTimeline extends ImmutablePureComponent { |
|
|
isLoading: PropTypes.bool, |
|
|
isLoading: PropTypes.bool, |
|
|
hasMore: PropTypes.bool, |
|
|
hasMore: PropTypes.bool, |
|
|
withReplies: PropTypes.bool, |
|
|
withReplies: PropTypes.bool, |
|
|
|
|
|
isAccount: PropTypes.bool, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
componentWillMount () { |
|
|
componentWillMount () { |
|
@ -73,7 +76,15 @@ export default class AccountTimeline extends ImmutablePureComponent { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
render () { |
|
|
render () { |
|
|
const { statusIds, featuredStatusIds, isLoading, hasMore } = this.props; |
|
|
|
|
|
|
|
|
const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
if (!isAccount) { |
|
|
|
|
|
return ( |
|
|
|
|
|
<Column> |
|
|
|
|
|
<MissingIndicator /> |
|
|
|
|
|
</Column> |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (!statusIds && isLoading) { |
|
|
if (!statusIds && isLoading) { |
|
|
return ( |
|
|
return ( |
|
|