From 9d5cbbbf0f74ab504dd3b84273338e1fb383aaf4 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 18 Mar 2025 11:32:35 +0100 Subject: [PATCH] Fix account notes not being displayed (#34166) --- .../features/account/components/account_note.jsx | 13 ++++++------- .../account/containers/account_note_container.js | 8 ++++---- .../account_timeline/components/account_header.tsx | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/javascript/mastodon/features/account/components/account_note.jsx b/app/javascript/mastodon/features/account/components/account_note.jsx index e736e7ad64..84fd6beeff 100644 --- a/app/javascript/mastodon/features/account/components/account_note.jsx +++ b/app/javascript/mastodon/features/account/components/account_note.jsx @@ -4,7 +4,6 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { is } from 'immutable'; -import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import Textarea from 'react-textarea-autosize'; @@ -49,7 +48,7 @@ class InlineAlert extends PureComponent { class AccountNote extends ImmutablePureComponent { static propTypes = { - account: ImmutablePropTypes.record.isRequired, + accountId: PropTypes.string.isRequired, value: PropTypes.string, onSave: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, @@ -66,7 +65,7 @@ class AccountNote extends ImmutablePureComponent { } UNSAFE_componentWillReceiveProps (nextProps) { - const accountWillChange = !is(this.props.account, nextProps.account); + const accountWillChange = !is(this.props.accountId, nextProps.accountId); const newState = {}; if (accountWillChange && this._isDirty()) { @@ -141,21 +140,21 @@ class AccountNote extends ImmutablePureComponent { } render () { - const { account, intl } = this.props; + const { accountId, intl } = this.props; const { value, saved } = this.state; - if (!account) { + if (!accountId) { return null; } return (
-