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
|
@ -90,9 +90,12 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||
|
||||
private async getUpdatedStatus(): Promise<void> {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const crypto = cli.crypto;
|
||||
if (!crypto) return;
|
||||
|
||||
const pkCache = cli.getCrossSigningCacheCallbacks();
|
||||
const crossSigning = cli.crypto!.crossSigningInfo;
|
||||
const secretStorage = cli.crypto!.secretStorage;
|
||||
const crossSigning = crypto.crossSigningInfo;
|
||||
const secretStorage = cli.secretStorage;
|
||||
const crossSigningPublicKeysOnDevice = Boolean(crossSigning.getId());
|
||||
const crossSigningPrivateKeysInStorage = Boolean(await crossSigning.isStoredInSecretStorage(secretStorage));
|
||||
const masterPrivateKeyCached = !!(await pkCache?.getCrossSigningKeyCache?.("master"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue