Kill off references to deprecated getStoredDevice
and getStoredDevicesForUser
(#11152)
* Use new `CryptoEvent.VerificationRequestReceived` event https://github.com/matrix-org/matrix-js-sdk/pull/3514 deprecates `CryptoEvent.VerificationRequest` in favour of `CryptoEvent.VerificationRequestReceived`. Use the new event. * Factor out `getDeviceCryptoInfo` function I seem to be writing this logic several times, so let's factor it out. * Factor out `getUserDeviceIds` function Another utility function * VerificationRequestToast: `getStoredDevice` -> `getDeviceCryptoInfo` * SlashCommands: `getStoredDevice` -> `getDeviceCryptoInfo` * MemberTile: `getStoredDevicesForUser` -> `getUserDeviceIds` * Remove redundant mock of `getStoredDevicesForUser`
This commit is contained in:
parent
0a3a111327
commit
46eb34a55d
11 changed files with 189 additions and 34 deletions
|
@ -36,6 +36,7 @@ import E2EIcon, { E2EState } from "../rooms/E2EIcon";
|
|||
import Spinner from "../elements/Spinner";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import VerificationShowSas from "../verification/VerificationShowSas";
|
||||
import { getDeviceCryptoInfo } from "../../../utils/crypto/deviceInfo";
|
||||
|
||||
interface IProps {
|
||||
layout: string;
|
||||
|
@ -224,12 +225,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
|||
return;
|
||||
}
|
||||
this.haveCheckedDevice = true;
|
||||
|
||||
const deviceMap = await client.getCrypto()?.getUserDeviceInfo([userId]);
|
||||
if (!deviceMap) return;
|
||||
const userDevices = deviceMap.get(userId);
|
||||
if (!userDevices) return;
|
||||
this.setState({ otherDeviceDetails: userDevices.get(deviceId) });
|
||||
this.setState({ otherDeviceDetails: await getDeviceCryptoInfo(client, userId, deviceId) });
|
||||
}
|
||||
|
||||
private renderQRReciprocatePhase(): JSX.Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue