diff options
author | ThibG <thib@sitedethib.com> | 2019-03-26 17:34:02 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-26 17:34:02 +0100 |
commit | 6df4a8296996181d56a22535b86830c0ab56086e (patch) | |
tree | eb4fb989ffcc587b87bdd127f5c1db47e45ec270 /app/javascript/mastodon/features/status/index.js | |
parent | 0c46bd11aa3dd5613ba49dfeed6971dc92587956 (diff) |
Add a “Block & Report” button to the block confirmation dialog (#10360)
Diffstat (limited to 'app/javascript/mastodon/features/status/index.js')
-rw-r--r-- | app/javascript/mastodon/features/status/index.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index 3b5febcac..c0ea460e8 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -57,6 +57,7 @@ const messages = defineMessages({ detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' }, replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' }, replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' }, + blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' }, }); const makeMapStateToProps = () => { @@ -253,13 +254,19 @@ class Status extends ImmutablePureComponent { } } - handleBlockClick = (account) => { + handleBlockClick = (status) => { const { dispatch, intl } = this.props; + const account = status.get('account'); dispatch(openModal('CONFIRM', { message: <FormattedMessage id='confirmations.block.message' defaultMessage='Are you sure you want to block {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />, confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.get('id'))), + secondary: intl.formatMessage(messages.blockAndReport), + onSecondary: () => { + dispatch(blockAccount(account.get('id'))); + dispatch(initReport(account, status)); + }, })); } |