about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/account_timeline/index.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-09-27 07:23:48 +0200
committerGitHub <noreply@github.com>2021-09-27 07:23:48 +0200
commit11502ae46e4813bc23aeb5d03093a01d53991ab8 (patch)
tree153f5953b8d144f78885fdeb3d04b7213ea9a26d /app/javascript/mastodon/features/account_timeline/index.js
parenta0d4129893c797f78d28ba9df5d35646f7bb0d80 (diff)
Add aliases for WebUI routes that were renamed in #16171 (#16772)
* Add aliases for some WebUI routes that were renamed in #16171

Accounts and statuses routes need more work as they use different parameters.

* Add aliases for /statuses/* routes

* Add aliases for /accounts/* WebUI routes

Does not correctly set the “active” state on the navigation tabs but this is
a minor issue.

* Fix some routes

* Fix /accounts/:id/{media,followers,following} not loading on legacy routes
Diffstat (limited to 'app/javascript/mastodon/features/account_timeline/index.js')
-rw-r--r--app/javascript/mastodon/features/account_timeline/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/mastodon/features/account_timeline/index.js b/app/javascript/mastodon/features/account_timeline/index.js
index 8ca768373..20f1dba9f 100644
--- a/app/javascript/mastodon/features/account_timeline/index.js
+++ b/app/javascript/mastodon/features/account_timeline/index.js
@@ -20,8 +20,8 @@ import { connectTimeline, disconnectTimeline } from 'mastodon/actions/timelines'
 
 const emptyList = ImmutableList();
 
-const mapStateToProps = (state, { params: { acct }, withReplies = false }) => {
-  const accountId = state.getIn(['accounts_map', acct]);
+const mapStateToProps = (state, { params: { acct, id }, withReplies = false }) => {
+  const accountId = id || state.getIn(['accounts_map', acct]);
 
   if (!accountId) {
     return {
@@ -58,7 +58,8 @@ class AccountTimeline 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,