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
This commit is contained in:
Claire
2021-09-27 07:23:48 +02:00
committed by GitHub
parent a0d4129893
commit 11502ae46e
6 changed files with 43 additions and 27 deletions

View File

@ -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,