mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Message Action Bar, subscribe to localEventIdReplaced events
This commit is contained in:
parent
b577667447
commit
f982c7b334
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user