Improve types for sendEvent (#12335)

This commit is contained in:
Michael Telatynski 2024-03-25 12:48:48 +00:00 committed by GitHub
parent 4941327c78
commit ef2bd7ae04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 209 additions and 99 deletions

View file

@ -26,6 +26,7 @@ import {
RoomType,
SyncStateData,
SyncState,
TimelineEvents,
} from "matrix-js-sdk/src/matrix";
import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils";
import { logger } from "matrix-js-sdk/src/logger";
@ -1930,7 +1931,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
const cli = MatrixClientPeg.get();
if (!cli) return;
cli.sendEvent(roomId, event.getType(), event.getContent()).then(() => {
cli.sendEvent(roomId, event.getType() as keyof TimelineEvents, event.getContent()).then(() => {
dis.dispatch({ action: "message_sent" });
});
}