From a2bf1f9f5698f5fb06267d9708e2d356a2a7786f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 29 Sep 2019 16:27:00 +0200 Subject: [PATCH] [Glitch] Fix follower/following lists resetting on back-navigation in web UI Port 9683e1dcf8bbddb07b818960abf254248be3575c to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/favourites/index.js | 4 +++- app/javascript/flavours/glitch/features/followers/index.js | 6 ++++-- app/javascript/flavours/glitch/features/following/index.js | 6 ++++-- app/javascript/flavours/glitch/features/reblogs/index.js | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js index 5c33c8677b..7afadf12ee 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.js +++ b/app/javascript/flavours/glitch/features/favourites/index.js @@ -31,7 +31,9 @@ class Favourites extends ImmutablePureComponent { }; componentWillMount () { - this.props.dispatch(fetchFavourites(this.props.params.statusId)); + if (!this.props.accountIds) { + this.props.dispatch(fetchFavourites(this.props.params.statusId)); + } } componentWillReceiveProps (nextProps) { diff --git a/app/javascript/flavours/glitch/features/followers/index.js b/app/javascript/flavours/glitch/features/followers/index.js index b12efa7749..2bd0e6e2f4 100644 --- a/app/javascript/flavours/glitch/features/followers/index.js +++ b/app/javascript/flavours/glitch/features/followers/index.js @@ -36,8 +36,10 @@ class Followers extends ImmutablePureComponent { }; componentWillMount () { - this.props.dispatch(fetchAccount(this.props.params.accountId)); - this.props.dispatch(fetchFollowers(this.props.params.accountId)); + if (!this.props.accountIds) { + this.props.dispatch(fetchAccount(this.props.params.accountId)); + this.props.dispatch(fetchFollowers(this.props.params.accountId)); + } } componentWillReceiveProps (nextProps) { diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js index 9ea008e614..f03da0c941 100644 --- a/app/javascript/flavours/glitch/features/following/index.js +++ b/app/javascript/flavours/glitch/features/following/index.js @@ -36,8 +36,10 @@ class Following extends ImmutablePureComponent { }; componentWillMount () { - this.props.dispatch(fetchAccount(this.props.params.accountId)); - this.props.dispatch(fetchFollowing(this.props.params.accountId)); + if (!this.props.accountIds) { + this.props.dispatch(fetchAccount(this.props.params.accountId)); + this.props.dispatch(fetchFollowing(this.props.params.accountId)); + } } componentWillReceiveProps (nextProps) { diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index 1fc26b0d79..a8e9db7f5a 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -31,7 +31,9 @@ class Reblogs extends ImmutablePureComponent { }; componentWillMount () { - this.props.dispatch(fetchReblogs(this.props.params.statusId)); + if (!this.props.accountIds) { + this.props.dispatch(fetchReblogs(this.props.params.statusId)); + } } componentWillReceiveProps(nextProps) {