From 0883f057531d291e8793bd3113f4331c502ad8cf Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 27 Feb 2022 07:37:00 +0100 Subject: [PATCH] Fix report submit button not being disabled during submission in web UI (#17654) Add loading indicator for status selection step in report dialog in web UI --- app/javascript/mastodon/features/report/comment.js | 2 +- app/javascript/mastodon/features/report/statuses.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/report/comment.js b/app/javascript/mastodon/features/report/comment.js index 8d1a4e21f..cde156415 100644 --- a/app/javascript/mastodon/features/report/comment.js +++ b/app/javascript/mastodon/features/report/comment.js @@ -74,7 +74,7 @@ class Comment extends React.PureComponent {
- +
); diff --git a/app/javascript/mastodon/features/report/statuses.js b/app/javascript/mastodon/features/report/statuses.js index 5999a0e06..d5d86034f 100644 --- a/app/javascript/mastodon/features/report/statuses.js +++ b/app/javascript/mastodon/features/report/statuses.js @@ -6,9 +6,11 @@ import StatusCheckBox from 'mastodon/features/report/containers/status_check_box import { OrderedSet } from 'immutable'; import { FormattedMessage } from 'react-intl'; import Button from 'mastodon/components/button'; +import LoadingIndicator from 'mastodon/components/loading_indicator'; const mapStateToProps = (state, { accountId }) => ({ availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])), + isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']), }); export default @connect(mapStateToProps) @@ -19,6 +21,7 @@ class Statuses extends React.PureComponent { accountId: PropTypes.string.isRequired, availableStatusIds: ImmutablePropTypes.set.isRequired, selectedStatusIds: ImmutablePropTypes.set.isRequired, + isLoading: PropTypes.bool, onToggle: PropTypes.func.isRequired, }; @@ -28,7 +31,7 @@ class Statuses extends React.PureComponent { }; render () { - const { availableStatusIds, selectedStatusIds, onToggle } = this.props; + const { availableStatusIds, selectedStatusIds, onToggle, isLoading } = this.props; return ( @@ -36,7 +39,7 @@ class Statuses extends React.PureComponent {

- {availableStatusIds.union(selectedStatusIds).map(statusId => ( + {isLoading ? : availableStatusIds.union(selectedStatusIds).map(statusId => (