From f982c7b334c5854538283f1f48bc60aefc7181e8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 14 Aug 2020 13:22:52 +0100 Subject: [PATCH] Message Action Bar, subscribe to localEventIdReplaced events --- src/components/views/messages/MessageActionBar.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/views/messages/MessageActionBar.js b/src/components/views/messages/MessageActionBar.js index 513f21b8b7..fa722a1e06 100644 --- a/src/components/views/messages/MessageActionBar.js +++ b/src/components/views/messages/MessageActionBar.js @@ -116,11 +116,13 @@ export default class MessageActionBar extends React.PureComponent { componentDidMount() { this.props.mxEvent.on("Event.decrypted", this.onDecrypted); this.props.mxEvent.on("Event.beforeRedaction", this.onBeforeRedaction); + this.props.mxEvent.on("Event.localEventIdReplaced", this.onEcho); } componentWillUnmount() { this.props.mxEvent.removeListener("Event.decrypted", this.onDecrypted); this.props.mxEvent.removeListener("Event.beforeRedaction", this.onBeforeRedaction); + this.props.mxEvent.removeListener("Event.localEventIdReplaced", this.onEcho); } onDecrypted = () => { @@ -134,6 +136,11 @@ export default class MessageActionBar extends React.PureComponent { this.forceUpdate(); }; + onEcho = () => { + // When an event is sent and echoed the possible actions change. + this.forceUpdate(); + }; + onFocusChange = (focused) => { if (!this.props.onFocusChange) { return;