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

Commit

Permalink
use matrixclientpeg in manual verification dialog (#11059)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry committed Jun 8, 2023
1 parent 87f3297 commit 5264aa6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Device } from "matrix-js-sdk/src/models/device";
import * as FormattingUtils from "../../../utils/FormattingUtils";
import { _t } from "../../../languageHandler";
import QuestionDialog from "./QuestionDialog";
import { useMatrixClientContext } from "../../../contexts/MatrixClientContext";
import { MatrixClientPeg } from "../../../MatrixClientPeg";

interface IManualDeviceKeyVerificationDialogProps {
userId: string;
Expand All @@ -37,11 +37,11 @@ export function ManualDeviceKeyVerificationDialog({
device,
onFinished,
}: IManualDeviceKeyVerificationDialogProps): JSX.Element {
const mxClient = useMatrixClientContext();
const mxClient = MatrixClientPeg.get();

const onLegacyFinished = useCallback(
(confirm: boolean) => {
if (confirm && mxClient) {
if (confirm) {
mxClient.setDeviceVerified(userId, device.deviceId, true);
}
onFinished(confirm);
Expand Down

0 comments on commit 5264aa6

Please sign in to comment.