@ -15,6 +15,8 @@ import { FormattedMessage } from 'react-intl';
import { fetchAccountIdentityProofs } from '../../actions/identity_proofs' ;
import MissingIndicator from 'mastodon/components/missing_indicator' ;
import TimelineHint from 'mastodon/components/timeline_hint' ;
import { me } from 'mastodon/initial_state' ;
import { connectUserTimelineStream } from '../../actions/streaming' ;
const emptyList = ImmutableList ( ) ;
@ -73,6 +75,12 @@ class AccountTimeline extends ImmutablePureComponent {
this . props . dispatch ( expandAccountTimeline ( accountId , { withReplies } ) ) ;
}
componentDidMount ( ) {
if ( this . props . params . accountId === me ) {
this . disconnect = this . props . dispatch ( connectUserTimelineStream ( me ) ) ;
}
}
componentWillReceiveProps ( nextProps ) {
if ( ( nextProps . params . accountId !== this . props . params . accountId && nextProps . params . accountId ) || nextProps . withReplies !== this . props . withReplies ) {
this . props . dispatch ( fetchAccount ( nextProps . params . accountId ) ) ;
@ -86,6 +94,13 @@ class AccountTimeline extends ImmutablePureComponent {
}
}
componentWillUnmount ( ) {
if ( this . disconnect ) {
this . disconnect ( ) ;
this . disconnect = null ;
}
}
handleLoadMore = maxId => {
this . props . dispatch ( expandAccountTimeline ( this . props . params . accountId , { maxId , withReplies : this . props . withReplies } ) ) ;
}