From 4be16a380ab5fbb3dc7da797d6e9db3b05f50c27 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 17:39:30 +0200 Subject: [PATCH] only show resend options if event hasn't been redacted (which can now be only local, which is why this wasn't neccesary before) --- .../views/context_menus/MessageContextMenu.js | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 4fe4304257..097b86d1a9 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -269,29 +269,30 @@ module.exports = React.createClass({ // status is SENT before remote-echo, null after const isSent = !eventStatus || eventStatus === EventStatus.SENT; + if (!mxEvent.isRedacted()) { + if (eventStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend') } +
+ ); + } - if (eventStatus === EventStatus.NOT_SENT) { - resendButton = ( -
- { _t('Resend') } -
- ); - } + if (editStatus === EventStatus.NOT_SENT) { + resendEditButton = ( +
+ { _t('Resend edit') } +
+ ); + } - if (editStatus === EventStatus.NOT_SENT) { - resendEditButton = ( -
- { _t('Resend edit') } -
- ); - } - - if (unsentReactionsCount !== 0) { - resendReactionsButton = ( -
- { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } -
- ); + if (unsentReactionsCount !== 0) { + resendReactionsButton = ( +
+ { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } +
+ ); + } } if (redactStatus === EventStatus.NOT_SENT) {