Message Action Bar, subscribe to localEventIdReplaced events
This commit is contained in:
parent
315435e3ef
commit
d34f166187
1 changed files with 7 additions and 0 deletions
|
@ -116,11 +116,13 @@ export default class MessageActionBar extends React.PureComponent {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
|
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
|
||||||
this.props.mxEvent.on("Event.beforeRedaction", this.onBeforeRedaction);
|
this.props.mxEvent.on("Event.beforeRedaction", this.onBeforeRedaction);
|
||||||
|
this.props.mxEvent.on("Event.localEventIdReplaced", this.onEcho);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.props.mxEvent.removeListener("Event.decrypted", this.onDecrypted);
|
this.props.mxEvent.removeListener("Event.decrypted", this.onDecrypted);
|
||||||
this.props.mxEvent.removeListener("Event.beforeRedaction", this.onBeforeRedaction);
|
this.props.mxEvent.removeListener("Event.beforeRedaction", this.onBeforeRedaction);
|
||||||
|
this.props.mxEvent.removeListener("Event.localEventIdReplaced", this.onEcho);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDecrypted = () => {
|
onDecrypted = () => {
|
||||||
|
@ -134,6 +136,11 @@ export default class MessageActionBar extends React.PureComponent {
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onEcho = () => {
|
||||||
|
// When an event is sent and echoed the possible actions change.
|
||||||
|
this.forceUpdate();
|
||||||
|
};
|
||||||
|
|
||||||
onFocusChange = (focused) => {
|
onFocusChange = (focused) => {
|
||||||
if (!this.props.onFocusChange) {
|
if (!this.props.onFocusChange) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue