Improve typing around event emitter handlers (#7816)

This commit is contained in:
Michael Telatynski 2022-02-22 12:18:08 +00:00 committed by GitHub
parent 213b32bf14
commit 7fa01ffb06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 548 additions and 471 deletions

View file

@ -24,7 +24,7 @@ import {
ILocationContent,
LOCATION_EVENT_TYPE,
} from 'matrix-js-sdk/src/@types/location';
import { IClientWellKnown } from 'matrix-js-sdk/src/client';
import { ClientEvent, IClientWellKnown } from 'matrix-js-sdk/src/client';
import SdkConfig from '../../../SdkConfig';
import { replaceableComponent } from "../../../utils/replaceableComponent";
@ -71,7 +71,7 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
return;
}
this.context.on("WellKnown.client", this.updateStyleUrl);
this.context.on(ClientEvent.ClientWellKnown, this.updateStyleUrl);
this.map = createMap(
this.coords,
@ -83,7 +83,7 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
}
componentWillUnmount() {
this.context.off("WellKnown.client", this.updateStyleUrl);
this.context.off(ClientEvent.ClientWellKnown, this.updateStyleUrl);
}
private updateStyleUrl = (clientWellKnown: IClientWellKnown) => {