about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/following/index.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-09-27 07:23:48 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-09-28 13:07:27 +0200
commit188d66c9a81b508fd6c036aaff05048c47d1ea72 (patch)
tree00f509c4cd57077d3a23dd472d28c9a3970a93fa /app/javascript/flavours/glitch/features/following/index.js
parentb2dd2e95ad13b31ae58eb23b2b0122519d8bc469 (diff)
[Glitch] Add aliases for WebUI routes that were renamed in #16171
Port 11502ae46e4813bc23aeb5d03093a01d53991ab8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/following/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/following/index.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js
index c1d026d98..446a19894 100644
--- a/app/javascript/flavours/glitch/features/following/index.js
+++ b/app/javascript/flavours/glitch/features/following/index.js
@@ -6,6 +6,7 @@ import { debounce } from 'lodash';
 import LoadingIndicator from 'flavours/glitch/components/loading_indicator';
 import {
   lookupAccount,
+  fetchAccount,
   fetchFollowing,
   expandFollowing,
 } from 'flavours/glitch/actions/accounts';
@@ -19,8 +20,8 @@ import MissingIndicator from 'flavours/glitch/components/missing_indicator';
 import ScrollableList from 'flavours/glitch/components/scrollable_list';
 import TimelineHint from 'flavours/glitch/components/timeline_hint';
 
-const mapStateToProps = (state, { params: { acct } }) => {
-  const accountId = state.getIn(['accounts_map', acct]);
+const mapStateToProps = (state, { params: { acct, id } }) => {
+  const accountId = id || state.getIn(['accounts_map', acct]);
 
   if (!accountId) {
     return {
@@ -52,7 +53,8 @@ class Following extends ImmutablePureComponent {
 
   static propTypes = {
     params: PropTypes.shape({
-      acct: PropTypes.string.isRequired,
+      acct: PropTypes.string,
+      id: PropTypes.string,
     }).isRequired,
     accountId: PropTypes.string,
     dispatch: PropTypes.func.isRequired,
@@ -66,8 +68,9 @@ class Following extends ImmutablePureComponent {
   };
 
   _load () {
-    const { accountId, dispatch } = this.props;
+    const { accountId, isAccount, dispatch } = this.props;
 
+    if (!isAccount) dispatch(fetchAccount(accountId));
     dispatch(fetchFollowing(accountId));
   }