Replace MatrixClient.isCryptoEnabled by MatrixClient.getCrypto (#140)
* Replace `MatrixClient.isCryptoEnabled` by `MatrixClient.getCrypto` * Cast `cryptoEnabled` as `boolean` * Fix `MatrixChat-test` (cherry picked from commit 950ab1940bfcea9443f03284f9175d319c13a44c)
This commit is contained in:
@@ -413,7 +413,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
|
||||
private async postLoginSetup(): Promise<void> {
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
const cryptoEnabled = cli.isCryptoEnabled();
|
||||
const cryptoEnabled = Boolean(cli.getCrypto());
|
||||
if (!cryptoEnabled) {
|
||||
this.onLoggedIn();
|
||||
}
|
||||
@@ -1619,7 +1619,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
.catch((e) => logger.error("Unable to start DecryptionFailureTracker", e));
|
||||
|
||||
cli.on(ClientEvent.Room, (room) => {
|
||||
if (cli.isCryptoEnabled()) {
|
||||
if (cli.getCrypto()) {
|
||||
const blacklistEnabled = SettingsStore.getValueAt(
|
||||
SettingLevel.ROOM_DEVICE,
|
||||
"blacklistUnverifiedDevices",
|
||||
@@ -1707,7 +1707,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
if (cli.isCryptoEnabled()) {
|
||||
if (cli.getCrypto()) {
|
||||
const blacklistEnabled = SettingsStore.getValueAt(SettingLevel.DEVICE, "blacklistUnverifiedDevices");
|
||||
cli.setGlobalBlacklistUnverifiedDevices(blacklistEnabled);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user