Merge pull request #3084 from matrix-org/jryans/update-action-bar-on-decrypt

Recheck message actions on decrypt
pull/21833/head
J. Ryan Stinnett 2019-06-10 16:53:35 +01:00 committed by GitHub
commit a47a46bd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,20 @@ export default class MessageActionBar extends React.PureComponent {
onFocusChange: PropTypes.func, 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) => { onFocusChange = (focused) => {
if (!this.props.onFocusChange) { if (!this.props.onFocusChange) {
return; return;