Settings panels: avoid exceptions with rust crypto (#10962)
* Settings panels: avoid exceptions with rust crypto If we are using rust crypto, `client.crypto` is undefined. We'll need to fix these up better in future, but for now, just return early. * Update tests
This commit is contained in:
parent
7c34d66bde
commit
161e19dfb6
5 changed files with 20 additions and 14 deletions
|
@ -146,14 +146,17 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
|
|||
|
||||
private async getUpdatedDiagnostics(): Promise<void> {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const secretStorage = cli.crypto!.secretStorage;
|
||||
const crypto = cli.crypto;
|
||||
if (!crypto) return;
|
||||
|
||||
const secretStorage = cli.secretStorage;
|
||||
|
||||
const backupKeyStored = !!(await cli.isKeyBackupKeyStored());
|
||||
const backupKeyFromCache = await cli.crypto!.getSessionBackupPrivateKey();
|
||||
const backupKeyFromCache = await crypto.getSessionBackupPrivateKey();
|
||||
const backupKeyCached = !!backupKeyFromCache;
|
||||
const backupKeyWellFormed = backupKeyFromCache instanceof Uint8Array;
|
||||
const secretStorageKeyInAccount = await secretStorage.hasKey();
|
||||
const secretStorageReady = await cli.isSecretStorageReady();
|
||||
const secretStorageReady = await crypto.isSecretStorageReady();
|
||||
|
||||
if (this.unmounted) return;
|
||||
this.setState({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue