Skip to content

Commit 9e4d6b4

Browse files
Gargronhiyuki2578
authored andcommitted
Fix follower/following lists resetting on back-navigation in web UI (mastodon#11986)
Fix mastodon#11452
1 parent 5ecb3ef commit 9e4d6b4

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

app/javascript/mastodon/features/favourites/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class Favourites extends ImmutablePureComponent {
2727
};
2828

2929
componentWillMount () {
30-
this.props.dispatch(fetchFavourites(this.props.params.statusId));
30+
if (!this.props.accountIds) {
31+
this.props.dispatch(fetchFavourites(this.props.params.statusId));
32+
}
3133
}
3234

3335
componentWillReceiveProps (nextProps) {

app/javascript/mastodon/features/followers/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ class Followers extends ImmutablePureComponent {
4040
};
4141

4242
componentWillMount () {
43-
this.props.dispatch(fetchAccount(this.props.params.accountId));
44-
this.props.dispatch(fetchFollowers(this.props.params.accountId));
43+
if (!this.props.accountIds) {
44+
this.props.dispatch(fetchAccount(this.props.params.accountId));
45+
this.props.dispatch(fetchFollowers(this.props.params.accountId));
46+
}
4547
}
4648

4749
componentWillReceiveProps (nextProps) {

app/javascript/mastodon/features/following/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ class Following extends ImmutablePureComponent {
4040
};
4141

4242
componentWillMount () {
43-
this.props.dispatch(fetchAccount(this.props.params.accountId));
44-
this.props.dispatch(fetchFollowing(this.props.params.accountId));
43+
if (!this.props.accountIds) {
44+
this.props.dispatch(fetchAccount(this.props.params.accountId));
45+
this.props.dispatch(fetchFollowing(this.props.params.accountId));
46+
}
4547
}
4648

4749
componentWillReceiveProps (nextProps) {

app/javascript/mastodon/features/reblogs/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class Reblogs extends ImmutablePureComponent {
2727
};
2828

2929
componentWillMount () {
30-
this.props.dispatch(fetchReblogs(this.props.params.statusId));
30+
if (!this.props.accountIds) {
31+
this.props.dispatch(fetchReblogs(this.props.params.statusId));
32+
}
3133
}
3234

3335
componentWillReceiveProps(nextProps) {

0 commit comments

Comments
 (0)