mirror of https://github.com/vector-im/riot-web
Use redaction enum event type rather than hardcoded string (#8071)
parent
176e49e312
commit
4e4ce65f58
|
@ -107,7 +107,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
|
||||||
const pendingEvents = room.getPendingEvents();
|
const pendingEvents = room.getPendingEvents();
|
||||||
for (const e of newEvents) {
|
for (const e of newEvents) {
|
||||||
const pendingRedaction = pendingEvents.find(pe => {
|
const pendingRedaction = pendingEvents.find(pe => {
|
||||||
return pe.getType() === "m.room.redaction" && pe.getAssociatedId() === e.getId();
|
return pe.getType() === EventType.RoomRedaction && pe.getAssociatedId() === e.getId();
|
||||||
});
|
});
|
||||||
if (pendingRedaction) {
|
if (pendingRedaction) {
|
||||||
e.markLocallyRedacted(pendingRedaction);
|
e.markLocallyRedacted(pendingRedaction);
|
||||||
|
|
|
@ -15,7 +15,15 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { renderToString } from "react-dom/server";
|
import { renderToString } from "react-dom/server";
|
||||||
import { IContent, MatrixClient, MatrixEvent, Room, RoomMember, RelationType } from "matrix-js-sdk/src/matrix";
|
import {
|
||||||
|
IContent,
|
||||||
|
MatrixClient,
|
||||||
|
MatrixEvent,
|
||||||
|
Room,
|
||||||
|
RoomMember,
|
||||||
|
RelationType,
|
||||||
|
EventType,
|
||||||
|
} from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
||||||
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
|
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
|
||||||
|
@ -71,7 +79,7 @@ describe('export', function() {
|
||||||
"origin_server_ts": ts0 + i*1000,
|
"origin_server_ts": ts0 + i*1000,
|
||||||
"redacts": "$9999999999999999999999999999999999999999998",
|
"redacts": "$9999999999999999999999999999999999999999998",
|
||||||
"sender": "@me:here",
|
"sender": "@me:here",
|
||||||
"type": "m.room.redaction",
|
"type": EventType.RoomRedaction,
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
"age": 94,
|
"age": 94,
|
||||||
"transaction_id": "m1111111111.1",
|
"transaction_id": "m1111111111.1",
|
||||||
|
|
Loading…
Reference in New Issue