diff --git a/src/components/views/dialogs/ConfirmRedactDialog.tsx b/src/components/views/dialogs/ConfirmRedactDialog.tsx index cd6ca8119e..f51b89131c 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import { Feature, ServerSupport } from "matrix-js-sdk/src/feature"; -import { MatrixEvent, RelationType } from "matrix-js-sdk/src/matrix"; +import { IRedactOpts, MatrixEvent, RelationType } from "matrix-js-sdk/src/matrix"; import React from "react"; import { _t } from "../../../languageHandler"; @@ -72,7 +72,7 @@ export function createRedactEventDialog({ if (!proceed) return; const cli = MatrixClientPeg.get(); - const withRelations: { with_relations?: RelationType[] } = {}; + const withRelTypes: Pick = {}; // redact related events if this is a voice broadcast started event and // server has support for relation based redactions @@ -82,7 +82,7 @@ export function createRedactEventDialog({ relationBasedRedactionsSupport && relationBasedRedactionsSupport !== ServerSupport.Unsupported ) { - withRelations.with_relations = [RelationType.Reference]; + withRelTypes.with_rel_types = [RelationType.Reference]; } } @@ -90,7 +90,7 @@ export function createRedactEventDialog({ onCloseDialog?.(); await cli.redactEvent(roomId, eventId, undefined, { ...(reason ? { reason } : {}), - ...withRelations, + ...withRelTypes, }); } catch (e: any) { const code = e.errcode || e.statusCode; diff --git a/test/components/views/dialogs/ConfirmRedactDialog-test.tsx b/test/components/views/dialogs/ConfirmRedactDialog-test.tsx index 33fc989966..57e386cb17 100644 --- a/test/components/views/dialogs/ConfirmRedactDialog-test.tsx +++ b/test/components/views/dialogs/ConfirmRedactDialog-test.tsx @@ -94,7 +94,7 @@ describe("ConfirmRedactDialog", () => { await confirmDeleteVoiceBroadcastStartedEvent(); }); - it("should call redact without `with_relations`", () => { + it("should call redact without `with_rel_types`", () => { expect(client.redactEvent).toHaveBeenCalledWith(roomId, mxEvent.getId(), undefined, {}); }); }); @@ -110,9 +110,9 @@ describe("ConfirmRedactDialog", () => { await confirmDeleteVoiceBroadcastStartedEvent(); }); - it("should call redact with `with_relations`", () => { + it("should call redact with `with_rel_types`", () => { expect(client.redactEvent).toHaveBeenCalledWith(roomId, mxEvent.getId(), undefined, { - with_relations: [RelationType.Reference], + with_rel_types: [RelationType.Reference], }); }); });