Fix follower/following lists resetting on back-navigation in web UI (#11986)

Fix #11452
lolsob-rspec
Eugen Rochko 2019-09-29 16:27:00 +02:00 committed by GitHub
parent ae03161ad9
commit aadf3981fa
4 changed files with 14 additions and 6 deletions

View File

@ -27,8 +27,10 @@ class Favourites extends ImmutablePureComponent {
}; };
componentWillMount () { componentWillMount () {
if (!this.props.accountIds) {
this.props.dispatch(fetchFavourites(this.props.params.statusId)); this.props.dispatch(fetchFavourites(this.props.params.statusId));
} }
}
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) { if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {

View File

@ -40,9 +40,11 @@ class Followers extends ImmutablePureComponent {
}; };
componentWillMount () { componentWillMount () {
if (!this.props.accountIds) {
this.props.dispatch(fetchAccount(this.props.params.accountId)); this.props.dispatch(fetchAccount(this.props.params.accountId));
this.props.dispatch(fetchFollowers(this.props.params.accountId)); this.props.dispatch(fetchFollowers(this.props.params.accountId));
} }
}
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) { if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {

View File

@ -40,9 +40,11 @@ class Following extends ImmutablePureComponent {
}; };
componentWillMount () { componentWillMount () {
if (!this.props.accountIds) {
this.props.dispatch(fetchAccount(this.props.params.accountId)); this.props.dispatch(fetchAccount(this.props.params.accountId));
this.props.dispatch(fetchFollowing(this.props.params.accountId)); this.props.dispatch(fetchFollowing(this.props.params.accountId));
} }
}
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) { if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {

View File

@ -27,8 +27,10 @@ class Reblogs extends ImmutablePureComponent {
}; };
componentWillMount () { componentWillMount () {
if (!this.props.accountIds) {
this.props.dispatch(fetchReblogs(this.props.params.statusId)); this.props.dispatch(fetchReblogs(this.props.params.statusId));
} }
}
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) { if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {