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
79 changed files with 548 additions and 471 deletions

View File

@@ -16,7 +16,7 @@ limitations under the License.
import React from 'react';
import { MatrixEvent } from 'matrix-js-sdk/src/models/event';
import { IClientWellKnown, MatrixClient } from 'matrix-js-sdk/src/client';
import { ClientEvent, IClientWellKnown, MatrixClient } from 'matrix-js-sdk/src/client';
import { replaceableComponent } from "../../../utils/replaceableComponent";
import BaseDialog from "../dialogs/BaseDialog";
@@ -53,7 +53,7 @@ export default class LocationViewDialog extends React.Component<IProps, IState>
return;
}
this.props.matrixClient.on("WellKnown.client", this.updateStyleUrl);
this.props.matrixClient.on(ClientEvent.ClientWellKnown, this.updateStyleUrl);
this.map = createMap(
this.coords,
@@ -65,7 +65,7 @@ export default class LocationViewDialog extends React.Component<IProps, IState>
}
componentWillUnmount() {
this.props.matrixClient.off("WellKnown.client", this.updateStyleUrl);
this.props.matrixClient.off(ClientEvent.ClientWellKnown, this.updateStyleUrl);
}
private updateStyleUrl = (clientWellKnown: IClientWellKnown) => {