Merge pull request #4036 from matrix-org/jryans/mkey-remove

Fix listener removal in verification tile
This commit is contained in:
J. Ryan Stinnett
2020-02-05 09:38:48 +00:00
committed by GitHub

View File

@@ -40,7 +40,10 @@ export default class MKeyVerificationConclusion extends React.Component {
if (request) {
request.off("change", this._onRequestChanged);
}
MatrixClientPeg.removeListener("userTrustStatusChanged", this._onTrustChanged);
const cli = MatrixClientPeg.get();
if (cli) {
cli.removeListener("userTrustStatusChanged", this._onTrustChanged);
}
}
_onRequestChanged = () => {