mirror of https://github.com/vector-im/riot-web
Merge pull request #2890 from jryans/guard-missing-crypto
Set E2E room status to warning when crypto is disabledpull/21833/head
commit
054011f5f8
src/components/structures
|
@ -730,8 +730,19 @@ module.exports = React.createClass({
|
||||||
if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) {
|
if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!MatrixClientPeg.get().isCryptoEnabled()) {
|
||||||
|
// If crypto is not currently enabled, we aren't tracking devices at all,
|
||||||
|
// so we don't know what the answer is. Let's error on the safe side and show
|
||||||
|
// a warning for this case.
|
||||||
|
this.setState({
|
||||||
|
e2eStatus: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
room.hasUnverifiedDevices().then((hasUnverifiedDevices) => {
|
room.hasUnverifiedDevices().then((hasUnverifiedDevices) => {
|
||||||
this.setState({e2eStatus: hasUnverifiedDevices ? "warning" : "verified"});
|
this.setState({
|
||||||
|
e2eStatus: hasUnverifiedDevices ? "warning" : "verified",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue