use matrixclientpeg in manual verification dialog (#11059)

pull/28217/head
Kerry 2023-06-09 10:03:01 +12:00 committed by GitHub
parent 87f329789b
commit 5264aa6138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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;
@ -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);