Improving typing around Message Edit History Dialog (#7342)

* Improving typing around Message Edit History Dialog

* Update Typescript to 4.5

* Depend on TS4.5

* Update types for TS4.5
pull/21833/head
Michael Telatynski 2021-12-13 12:42:36 +00:00 committed by GitHub
parent c96b9413e7
commit a46de3b9b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
import { defer } from "matrix-js-sdk/src/utils";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixClient } from 'matrix-js-sdk/src/client';
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { _t } from '../../../languageHandler';
@ -72,11 +73,10 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
const client = MatrixClientPeg.get();
const { resolve, reject, promise } = defer<boolean>();
let result;
let result: Awaited<ReturnType<MatrixClient["relations"]>>;
try {
result = await client.relations(
roomId, eventId, RelationType.Replace, EventType.RoomMessage, opts);
result = await client.relations(roomId, eventId, RelationType.Replace, EventType.RoomMessage, opts);
} catch (error) {
// log if the server returned an error
if (error.errcode) {