From 77f22e5293e0eaedd0531812d8fc4826ed15ae19 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 2 Oct 2021 15:45:14 -0500 Subject: [PATCH] AccountTimeline: fix fetchAccountByUsername when switching between two profiles --- app/soapbox/features/account_timeline/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/account_timeline/index.js b/app/soapbox/features/account_timeline/index.js index 549a96478..8b17fcb2b 100644 --- a/app/soapbox/features/account_timeline/index.js +++ b/app/soapbox/features/account_timeline/index.js @@ -110,8 +110,9 @@ class AccountTimeline extends ImmutablePureComponent { } componentDidUpdate(prevProps) { - const { me, accountId, withReplies, accountApId, patronEnabled } = this.props; - if (accountId && accountId !== -1 && (accountId !== prevProps.accountId && accountId) || withReplies !== prevProps.withReplies) { + const { params: { username }, me, accountId, withReplies, accountApId, patronEnabled } = this.props; + + if (accountId && (accountId !== -1) && (accountId !== prevProps.accountId) || withReplies !== prevProps.withReplies) { this.props.dispatch(fetchAccount(accountId)); if (me) this.props.dispatch(fetchAccountIdentityProofs(accountId)); @@ -124,6 +125,8 @@ class AccountTimeline extends ImmutablePureComponent { } this.props.dispatch(expandAccountTimeline(accountId, { withReplies })); + } else if (username && (username !== prevProps.params.username)) { + this.props.dispatch(fetchAccountByUsername(username)); } }