Fix listener removal in verification tile

Fixes https://github.com/matrix-org/riot-web-rageshakes/issues/2202
This commit is contained in:
J. Ryan Stinnett 2020-02-04 23:13:55 +00:00
parent f89ae19d76
commit 110c5f0e61

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 = () => {