mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Adjust secret storage to work before sync
This adjusts to changed JS SDK APIs that allow secret storage to optionally ask the server for any account data needed at login. Fixes https://github.com/vector-im/riot-web/issues/11901
This commit is contained in:
parent
e88f062f01
commit
4a82e86859
2 changed files with 4 additions and 4 deletions
|
@ -107,7 +107,7 @@ export async function accessSecretStorage(func = async () => { }) {
|
|||
cachingAllowed = true;
|
||||
|
||||
try {
|
||||
if (!cli.hasSecretStorageKey()) {
|
||||
if (!await cli.hasSecretStorageKey()) {
|
||||
// This dialog calls bootstrap itself after guiding the user through
|
||||
// passphrase creation.
|
||||
const { finished } = Modal.createTrackedDialogAsync('Create Secret Storage dialog', '',
|
||||
|
|
|
@ -60,14 +60,14 @@ export default class CrossSigningPanel extends React.PureComponent {
|
|||
this.setState(this._getUpdatedStatus());
|
||||
};
|
||||
|
||||
_getUpdatedStatus() {
|
||||
async _getUpdatedStatus() {
|
||||
// XXX: Add public accessors if we keep this around in production
|
||||
const cli = MatrixClientPeg.get();
|
||||
const crossSigning = cli._crypto._crossSigningInfo;
|
||||
const secretStorage = cli._crypto._secretStorage;
|
||||
const crossSigningPublicKeysOnDevice = crossSigning.getId();
|
||||
const crossSigningPrivateKeysInStorage = crossSigning.isStoredInSecretStorage(secretStorage);
|
||||
const secretStorageKeyInAccount = secretStorage.hasKey();
|
||||
const crossSigningPrivateKeysInStorage = await crossSigning.isStoredInSecretStorage(secretStorage);
|
||||
const secretStorageKeyInAccount = await secretStorage.hasKey();
|
||||
|
||||
return {
|
||||
crossSigningPublicKeysOnDevice,
|
||||
|
|
Loading…
Reference in a new issue