[Glitch] Fix follower/following lists resetting on back-navigation in web UI

Port 9683e1dcf8 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko 2019-09-29 16:27:00 +02:00 committed by Thibaut Girka
parent 15973b77d6
commit a2bf1f9f56
4 changed files with 14 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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