mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Use the New Session review dialog for verifying our own devices
This commit is contained in:
parent
3bdd24ce83
commit
ff1fd15e72
@ -191,6 +191,17 @@ function DeviceItem({userId, device}) {
|
||||
device.getDisplayName();
|
||||
let trustedLabel = null;
|
||||
if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted");
|
||||
|
||||
|
||||
if (isVerified) {
|
||||
return (
|
||||
<div className={classes} title={device.deviceId} >
|
||||
<div className={iconClasses} />
|
||||
<div className="mx_UserInfo_device_name">{deviceName}</div>
|
||||
<div className="mx_UserInfo_device_trusted">{trustedLabel}</div>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<AccessibleButton
|
||||
className={classes}
|
||||
@ -203,6 +214,7 @@ function DeviceItem({userId, device}) {
|
||||
</AccessibleButton>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function DevicesSection({devices, userId, loading}) {
|
||||
const Spinner = sdk.getComponent("elements.Spinner");
|
||||
|
@ -23,6 +23,7 @@ import {RIGHT_PANEL_PHASES} from "./stores/RightPanelStorePhases";
|
||||
import {findDMForUser} from './createRoom';
|
||||
import {accessSecretStorage} from './CrossSigningManager';
|
||||
import SettingsStore from './settings/SettingsStore';
|
||||
import NewSessionReviewDialog from './components/views/dialogs/NewSessionReviewDialog';
|
||||
import {verificationMethods} from 'matrix-js-sdk/src/crypto';
|
||||
|
||||
async function enable4SIfNeeded() {
|
||||
@ -68,6 +69,13 @@ export async function verifyDevice(user, device) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (user.userId === cli.getUserId()) {
|
||||
Modal.createTrackedDialog('New Session Review', 'Starting dialog', NewSessionReviewDialog, {
|
||||
userId: user.userId,
|
||||
device,
|
||||
});
|
||||
} else {
|
||||
Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, {
|
||||
user,
|
||||
device,
|
||||
@ -96,6 +104,7 @@ export async function verifyDevice(user, device) {
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function legacyVerifyUser(user) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
Loading…
Reference in New Issue
Block a user