Add some catches
parent
01c5f84f60
commit
f2e2f1699b
|
@ -222,34 +222,44 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
||||||
// rest of this function.
|
// rest of this function.
|
||||||
Modal.toggleCurrentDialogVisibility();
|
Modal.toggleCurrentDialogVisibility();
|
||||||
|
|
||||||
// Force reset secret storage (which resets the key backup)
|
try {
|
||||||
await accessSecretStorage(async () => {
|
// Force reset secret storage (which resets the key backup)
|
||||||
// Now reset cross-signing so everything Just Works™ again.
|
await accessSecretStorage(async () => {
|
||||||
const cli = MatrixClientPeg.get();
|
try {
|
||||||
await cli.bootstrapCrossSigning({
|
// Now reset cross-signing so everything Just Works™ again.
|
||||||
authUploadDeviceSigningKeys: async (makeRequest) => {
|
const cli = MatrixClientPeg.get();
|
||||||
// XXX: Making this an import breaks the app.
|
await cli.bootstrapCrossSigning({
|
||||||
const InteractiveAuthDialog = sdk.getComponent("views.dialogs.InteractiveAuthDialog");
|
authUploadDeviceSigningKeys: async (makeRequest) => {
|
||||||
const { finished } = Modal.createTrackedDialog(
|
// XXX: Making this an import breaks the app.
|
||||||
'Cross-signing keys dialog', '', InteractiveAuthDialog,
|
const InteractiveAuthDialog = sdk.getComponent("views.dialogs.InteractiveAuthDialog");
|
||||||
{
|
const {finished} = Modal.createTrackedDialog(
|
||||||
title: _t("Setting up keys"),
|
'Cross-signing keys dialog', '', InteractiveAuthDialog,
|
||||||
matrixClient: cli,
|
{
|
||||||
makeRequest,
|
title: _t("Setting up keys"),
|
||||||
|
matrixClient: cli,
|
||||||
|
makeRequest,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
const [confirmed] = await finished;
|
||||||
|
if (!confirmed) {
|
||||||
|
throw new Error("Cross-signing key upload auth canceled");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
setupNewCrossSigning: true,
|
||||||
const [confirmed] = await finished;
|
});
|
||||||
if (!confirmed) {
|
|
||||||
throw new Error("Cross-signing key upload auth canceled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setupNewCrossSigning: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 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);
|
||||||
}, true);
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
this.props.onFinished(false);
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
this.props.onFinished(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private getKeyValidationText(): string {
|
private getKeyValidationText(): string {
|
||||||
|
|
Loading…
Reference in New Issue