You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Fix upgrading with already trusted backup
This commit is contained in:
@@ -68,7 +68,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
|||||||
// does the server offer a UI auth flow with just m.login.password
|
// does the server offer a UI auth flow with just m.login.password
|
||||||
// for /keys/device_signing/upload? (If we have an account password, we
|
// for /keys/device_signing/upload? (If we have an account password, we
|
||||||
// assume that it can)
|
// assume that it can)
|
||||||
canUploadKeysWithPasswordOnly: Boolean(this.state.accountPassword),
|
canUploadKeysWithPasswordOnly: null,
|
||||||
canUploadKeyCheckInProgress: false,
|
canUploadKeyCheckInProgress: false,
|
||||||
accountPassword: props.accountPassword || "",
|
accountPassword: props.accountPassword || "",
|
||||||
accountPasswordCorrect: null,
|
accountPasswordCorrect: null,
|
||||||
@@ -76,6 +76,12 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
|||||||
useKeyBackup: true,
|
useKeyBackup: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (props.accountPassword) {
|
||||||
|
// If we have an account password, we assume we can upload keys with
|
||||||
|
// just a password (otherwise leave it as null so we poll to check)
|
||||||
|
this.state.canUploadKeysWithPasswordOnly = true;
|
||||||
|
}
|
||||||
|
|
||||||
this._passphraseField = createRef();
|
this._passphraseField = createRef();
|
||||||
|
|
||||||
this.loadData();
|
this.loadData();
|
||||||
@@ -375,7 +381,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
|||||||
<div>{_t("Restore your key backup to upgrade your encryption")}</div>
|
<div>{_t("Restore your key backup to upgrade your encryption")}</div>
|
||||||
</div>;
|
</div>;
|
||||||
nextCaption = _t("Restore");
|
nextCaption = _t("Restore");
|
||||||
} else if (this.state.canUploadKeysWithPasswordOnly && !this.state.accountPassword) {
|
} else if (this.state.canUploadKeysWithPasswordOnly && !this.props.accountPassword) {
|
||||||
authPrompt = <div>
|
authPrompt = <div>
|
||||||
<div>{_t("Enter your account password to confirm the upgrade:")}</div>
|
<div>{_t("Enter your account password to confirm the upgrade:")}</div>
|
||||||
<div><Field
|
<div><Field
|
||||||
|
|||||||
Reference in New Issue
Block a user