mirror of https://github.com/vector-im/riot-web
simple optimization to bail out of check on first failure
parent
9706114bb5
commit
b7d1c17ad1
|
@ -812,10 +812,10 @@ export default createReactClass({
|
||||||
/* Check all verified user devices. */
|
/* Check all verified user devices. */
|
||||||
for (const userId of verified) {
|
for (const userId of verified) {
|
||||||
const devices = await cli.getStoredDevicesForUser(userId);
|
const devices = await cli.getStoredDevicesForUser(userId);
|
||||||
const allDevicesVerified = devices.every(({deviceId}) => {
|
const anyDeviceNotVerified = devices.some(({deviceId}) => {
|
||||||
return cli.checkDeviceTrust(userId, deviceId).isVerified();
|
return !cli.checkDeviceTrust(userId, deviceId).isVerified();
|
||||||
});
|
});
|
||||||
if (!allDevicesVerified) {
|
if (anyDeviceNotVerified) {
|
||||||
this.setState({
|
this.setState({
|
||||||
e2eStatus: "warning",
|
e2eStatus: "warning",
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue