Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 4e4ce65

Browse files
author
Germain
authored
Use redaction enum event type rather than hardcoded string (#8071)
1 parent 176e49e commit 4e4ce65

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/components/views/dialogs/MessageEditHistoryDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
107107
const pendingEvents = room.getPendingEvents();
108108
for (const e of newEvents) {
109109
const pendingRedaction = pendingEvents.find(pe => {
110-
return pe.getType() === "m.room.redaction" && pe.getAssociatedId() === e.getId();
110+
return pe.getType() === EventType.RoomRedaction && pe.getAssociatedId() === e.getId();
111111
});
112112
if (pendingRedaction) {
113113
e.markLocallyRedacted(pendingRedaction);

test/utils/export-test.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ limitations under the License.
1515
*/
1616

1717
import { renderToString } from "react-dom/server";
18-
import { IContent, MatrixClient, MatrixEvent, Room, RoomMember, RelationType } from "matrix-js-sdk/src/matrix";
18+
import {
19+
IContent,
20+
MatrixClient,
21+
MatrixEvent,
22+
Room,
23+
RoomMember,
24+
RelationType,
25+
EventType,
26+
} from "matrix-js-sdk/src/matrix";
1927

2028
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
2129
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
@@ -71,7 +79,7 @@ describe('export', function() {
7179
"origin_server_ts": ts0 + i*1000,
7280
"redacts": "$9999999999999999999999999999999999999999998",
7381
"sender": "@me:here",
74-
"type": "m.room.redaction",
82+
"type": EventType.RoomRedaction,
7583
"unsigned": {
7684
"age": 94,
7785
"transaction_id": "m1111111111.1",

0 commit comments

Comments
 (0)