From aca41fe80aa55ca8f076713f7269c5780eab6e14 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 18 Jul 2019 14:09:29 +0200 Subject: [PATCH] dont show remove button for original event in edit history --- .../views/dialogs/MessageEditHistoryDialog.js | 10 +++++++++- src/components/views/messages/EditHistoryMessage.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.js b/src/components/views/dialogs/MessageEditHistoryDialog.js index 9ba570292f..56e208e464 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.js +++ b/src/components/views/dialogs/MessageEditHistoryDialog.js @@ -107,11 +107,19 @@ export default class MessageEditHistoryDialog extends React.PureComponent { if (this.state.originalEvent && !this.state.nextBatch) { allEvents = allEvents.concat(this.state.originalEvent); } + const baseEventId = this.props.mxEvent.getId(); allEvents.forEach(e => { if (!lastEvent || wantsDateSeparator(lastEvent.getDate(), e.getDate())) { nodes.push(
  • ); } - nodes.push(); + const isBaseEvent = e.getId() === baseEventId; + nodes.push(( + )); lastEvent = e; }); return nodes; diff --git a/src/components/views/messages/EditHistoryMessage.js b/src/components/views/messages/EditHistoryMessage.js index fe8d465698..b95f57c723 100644 --- a/src/components/views/messages/EditHistoryMessage.js +++ b/src/components/views/messages/EditHistoryMessage.js @@ -94,7 +94,7 @@ export default class EditHistoryMessage extends React.PureComponent { const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); // hide the button when already redacted let redactButton; - if (!this.props.mxEvent.isRedacted()) { + if (!this.props.mxEvent.isRedacted() && !this.props.isBaseEvent) { redactButton = ( {_t("Remove")}