mirror of https://github.com/vector-im/riot-web
Add some catches
parent
01c5f84f60
commit
f2e2f1699b
|
@ -222,15 +222,17 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
||||||
// rest of this function.
|
// rest of this function.
|
||||||
Modal.toggleCurrentDialogVisibility();
|
Modal.toggleCurrentDialogVisibility();
|
||||||
|
|
||||||
|
try {
|
||||||
// Force reset secret storage (which resets the key backup)
|
// Force reset secret storage (which resets the key backup)
|
||||||
await accessSecretStorage(async () => {
|
await accessSecretStorage(async () => {
|
||||||
|
try {
|
||||||
// Now reset cross-signing so everything Just Works™ again.
|
// Now reset cross-signing so everything Just Works™ again.
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
await cli.bootstrapCrossSigning({
|
await cli.bootstrapCrossSigning({
|
||||||
authUploadDeviceSigningKeys: async (makeRequest) => {
|
authUploadDeviceSigningKeys: async (makeRequest) => {
|
||||||
// XXX: Making this an import breaks the app.
|
// XXX: Making this an import breaks the app.
|
||||||
const InteractiveAuthDialog = sdk.getComponent("views.dialogs.InteractiveAuthDialog");
|
const InteractiveAuthDialog = sdk.getComponent("views.dialogs.InteractiveAuthDialog");
|
||||||
const { finished } = Modal.createTrackedDialog(
|
const {finished} = Modal.createTrackedDialog(
|
||||||
'Cross-signing keys dialog', '', InteractiveAuthDialog,
|
'Cross-signing keys dialog', '', InteractiveAuthDialog,
|
||||||
{
|
{
|
||||||
title: _t("Setting up keys"),
|
title: _t("Setting up keys"),
|
||||||
|
@ -249,7 +251,15 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
||||||
// Now we can indicate that the user is done pressing buttons, finally.
|
// 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.
|
// Upstream flows will detect the new secret storage, key backup, etc and use it.
|
||||||
this.props.onFinished(true);
|
this.props.onFinished(true);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
this.props.onFinished(false);
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
this.props.onFinished(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private getKeyValidationText(): string {
|
private getKeyValidationText(): string {
|
||||||
|
|
Loading…
Reference in New Issue