use matrixclientpeg in manual verification dialog (#11059)
This commit is contained in:
parent
87f329789b
commit
5264aa6138
1 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ import { Device } from "matrix-js-sdk/src/models/device";
|
||||||
import * as FormattingUtils from "../../../utils/FormattingUtils";
|
import * as FormattingUtils from "../../../utils/FormattingUtils";
|
||||||
import { _t } from "../../../languageHandler";
|
import { _t } from "../../../languageHandler";
|
||||||
import QuestionDialog from "./QuestionDialog";
|
import QuestionDialog from "./QuestionDialog";
|
||||||
import { useMatrixClientContext } from "../../../contexts/MatrixClientContext";
|
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||||
|
|
||||||
interface IManualDeviceKeyVerificationDialogProps {
|
interface IManualDeviceKeyVerificationDialogProps {
|
||||||
userId: string;
|
userId: string;
|
||||||
|
@ -37,11 +37,11 @@ export function ManualDeviceKeyVerificationDialog({
|
||||||
device,
|
device,
|
||||||
onFinished,
|
onFinished,
|
||||||
}: IManualDeviceKeyVerificationDialogProps): JSX.Element {
|
}: IManualDeviceKeyVerificationDialogProps): JSX.Element {
|
||||||
const mxClient = useMatrixClientContext();
|
const mxClient = MatrixClientPeg.get();
|
||||||
|
|
||||||
const onLegacyFinished = useCallback(
|
const onLegacyFinished = useCallback(
|
||||||
(confirm: boolean) => {
|
(confirm: boolean) => {
|
||||||
if (confirm && mxClient) {
|
if (confirm) {
|
||||||
mxClient.setDeviceVerified(userId, device.deviceId, true);
|
mxClient.setDeviceVerified(userId, device.deviceId, true);
|
||||||
}
|
}
|
||||||
onFinished(confirm);
|
onFinished(confirm);
|
||||||
|
|
Loading…
Reference in a new issue