[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>
master
Eugen Rochko 5 years ago committed by Thibaut Girka
parent 15973b77d6
commit a2bf1f9f56
  1. 2
      app/javascript/flavours/glitch/features/favourites/index.js
  2. 2
      app/javascript/flavours/glitch/features/followers/index.js
  3. 2
      app/javascript/flavours/glitch/features/following/index.js
  4. 2
      app/javascript/flavours/glitch/features/reblogs/index.js

@ -31,8 +31,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) {

@ -36,9 +36,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) {

@ -36,9 +36,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) {

@ -31,8 +31,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) {

Loading…
Cancel
Save