AccountTimeline: fix fetchAccountByUsername when switching between two profiles
This commit is contained in:
parent
d3908f107a
commit
77f22e5293
1 changed files with 5 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue