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.5pull/21833/head
parent
c96b9413e7
commit
a46de3b9b3
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue