Use enums

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-09-13 18:05:59 +02:00
parent 71e84ccb75
commit adb325b3bd
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -27,6 +27,7 @@ import Spinner from "../elements/Spinner";
import EditHistoryMessage from "../messages/EditHistoryMessage"; import EditHistoryMessage from "../messages/EditHistoryMessage";
import DateSeparator from "../messages/DateSeparator"; import DateSeparator from "../messages/DateSeparator";
import { IDialogProps } from "./IDialogProps"; import { IDialogProps } from "./IDialogProps";
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
interface IProps extends IDialogProps { interface IProps extends IDialogProps {
mxEvent: MatrixEvent; mxEvent: MatrixEvent;
@ -72,7 +73,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
const promise = new Promise<boolean>((_resolve, _reject) => {resolve = _resolve; reject = _reject;}); const promise = new Promise<boolean>((_resolve, _reject) => {resolve = _resolve; reject = _reject;});
try { try {
result = await client.relations( result = await client.relations(
roomId, eventId, "m.replace", "m.room.message", opts); roomId, eventId, RelationType.Replace, EventType.RoomMessage, opts);
} catch (error) { } catch (error) {
// log if the server returned an error // log if the server returned an error
if (error.errcode) { if (error.errcode) {