Prefer account password variation of upgrading

This shows the account password variation of upgrade encryption first if it's
possible to do so. This ensures we match the logic that locks the next button.

Fixes https://github.com/vector-im/riot-web/issues/12560
This commit is contained in:
J. Ryan Stinnett 2020-02-28 11:25:04 +00:00
parent 5325b5677f
commit a93c13306c

View file

@ -400,12 +400,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
let authPrompt; let authPrompt;
let nextCaption = _t("Next"); let nextCaption = _t("Next");
if (!this.state.backupSigStatus.usable) { if (this.state.canUploadKeysWithPasswordOnly) {
authPrompt = <div>
<div>{_t("Restore your key backup to upgrade your encryption")}</div>
</div>;
nextCaption = _t("Restore");
} else if (this.state.canUploadKeysWithPasswordOnly) {
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
@ -418,6 +413,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
autoFocus={true} autoFocus={true}
/></div> /></div>
</div>; </div>;
} else if (!this.state.backupSigStatus.usable) {
authPrompt = <div>
<div>{_t("Restore your key backup to upgrade your encryption")}</div>
</div>;
nextCaption = _t("Restore");
} else { } else {
authPrompt = <p> authPrompt = <p>
{_t("You'll need to authenticate with the server to confirm the upgrade.")} {_t("You'll need to authenticate with the server to confirm the upgrade.")}