Merge pull request #2684 from matrix-org/travis/fix-e2e-menu-item

Only set e2e info callback if the event is encrypted
pull/21833/head
Travis Ralston 2019-02-25 07:31:17 -07:00 committed by GitHub
commit 8049d5c2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -321,6 +321,9 @@ module.exports = withMatrixClient(React.createClass({
const {tile, replyThread} = this.refs; const {tile, replyThread} = this.refs;
let e2eInfoCallback = null;
if (this.props.mxEvent.isEncrypted()) e2eInfoCallback = () => this.onCryptoClicked();
ContextualMenu.createMenu(MessageContextMenu, { ContextualMenu.createMenu(MessageContextMenu, {
chevronOffset: 10, chevronOffset: 10,
mxEvent: this.props.mxEvent, mxEvent: this.props.mxEvent,
@ -328,7 +331,7 @@ module.exports = withMatrixClient(React.createClass({
top: y, top: y,
eventTileOps: tile && tile.getEventTileOps ? tile.getEventTileOps() : undefined, eventTileOps: tile && tile.getEventTileOps ? tile.getEventTileOps() : undefined,
collapseReplyThread: replyThread && replyThread.canCollapse() ? replyThread.collapse : undefined, collapseReplyThread: replyThread && replyThread.canCollapse() ? replyThread.collapse : undefined,
e2eInfoCallback: () => this.onCryptoClicked(), e2eInfoCallback: e2eInfoCallback,
onFinished: function() { onFinished: function() {
self.setState({menu: false}); self.setState({menu: false});
}, },