You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Update cross-signing details on trust changes
This commit is contained in:
@@ -36,6 +36,8 @@ export default class CrossSigningPanel extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const cli = MatrixClientPeg.get();
|
||||
cli.on("accountData", this.onAccountData);
|
||||
cli.on("userTrustStatusChanged", this.onStatusChanged);
|
||||
cli.on("crossSigning.keysChanged", this.onStatusChanged);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -43,6 +45,8 @@ export default class CrossSigningPanel extends React.PureComponent {
|
||||
const cli = MatrixClientPeg.get();
|
||||
if (!cli) return;
|
||||
cli.removeListener("accountData", this.onAccountData);
|
||||
cli.removeListener("userTrustStatusChanged", this.onStatusChanged);
|
||||
cli.removeListener("crossSigning.keysChanged", this.onStatusChanged);
|
||||
}
|
||||
|
||||
onAccountData = (event) => {
|
||||
@@ -52,6 +56,10 @@ export default class CrossSigningPanel extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
onStatusChanged = () => {
|
||||
this.setState(this._getUpdatedStatus());
|
||||
};
|
||||
|
||||
_getUpdatedStatus() {
|
||||
// XXX: Add public accessors if we keep this around in production
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
||||
Reference in New Issue
Block a user