Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Adjust secret storage to work before sync #3864

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CrossSigningManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '',
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/settings/CrossSigningPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down