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
pull/21833/head
J. Ryan Stinnett 2020-02-28 11:25:04 +00:00
parent 5325b5677f
commit a93c13306c
1 changed files with 6 additions and 6 deletions

View File

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