1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

Add some catches

This commit is contained in:
Travis Ralston
2021-04-08 18:09:41 -06:00
parent 01c5f84f60
commit f2e2f1699b

View File

@@ -222,8 +222,10 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
// rest of this function.
Modal.toggleCurrentDialogVisibility();
try {
// Force reset secret storage (which resets the key backup)
await accessSecretStorage(async () => {
try {
// Now reset cross-signing so everything Just Works™ again.
const cli = MatrixClientPeg.get();
await cli.bootstrapCrossSigning({
@@ -249,7 +251,15 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
// Now we can indicate that the user is done pressing buttons, finally.
// Upstream flows will detect the new secret storage, key backup, etc and use it.
this.props.onFinished(true);
} catch (e) {
console.error(e);
this.props.onFinished(false);
}
}, true);
} catch (e) {
console.error(e);
this.props.onFinished(false);
}
};
private getKeyValidationText(): string {