mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Recheck message actions on decrypt
This changes the message action bar to force an update after an event decrypts, since it's quite likely that changes the set of available actions. Fixes https://github.com/vector-im/riot-web/issues/9991
This commit is contained in:
parent
41cbfe0d27
commit
73d2d78c33
1 changed files with 14 additions and 0 deletions
|
@ -36,6 +36,20 @@ export default class MessageActionBar extends React.PureComponent {
|
|||
onFocusChange: PropTypes.func,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.mxEvent.removeListener("Event.decrypted", this.onDecrypted);
|
||||
}
|
||||
|
||||
onDecrypted = () => {
|
||||
// When an event decrypts, it is likely to change the set of available
|
||||
// actions, so we force an update to check again.
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
onFocusChange = (focused) => {
|
||||
if (!this.props.onFocusChange) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue