Use enums
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
71e84ccb75
commit
adb325b3bd
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue