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
commit d3cf4f132c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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