mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 07:31:38 +01:00
Merge branch 'master' into sas-verification
This commit is contained in:
commit
18d735b771
@ -26,7 +26,8 @@ import type {CrossSigning} from "../../../matrix/verification/CrossSigning";
|
||||
|
||||
export enum Status {
|
||||
Enabled,
|
||||
Setup,
|
||||
SetupWithPassphrase,
|
||||
SetupWithRecoveryKey,
|
||||
Pending,
|
||||
NewVersionAvailable
|
||||
};
|
||||
@ -108,7 +109,10 @@ export class KeyBackupViewModel extends ViewModel<SegmentType, Options> {
|
||||
return keyBackup.needsNewKey ? Status.NewVersionAvailable : Status.Enabled;
|
||||
}
|
||||
} else {
|
||||
return Status.Setup;
|
||||
switch (this._setupKeyType) {
|
||||
case KeyType.RecoveryKey: return Status.SetupWithRecoveryKey;
|
||||
case KeyType.Passphrase: return Status.SetupWithPassphrase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,21 +183,13 @@ export class KeyBackupViewModel extends ViewModel<SegmentType, Options> {
|
||||
}
|
||||
|
||||
showPhraseSetup(): void {
|
||||
if (this._status === Status.Setup) {
|
||||
this._setupKeyType = KeyType.Passphrase;
|
||||
this.emitChange("setupKeyType");
|
||||
}
|
||||
this._setupKeyType = KeyType.Passphrase;
|
||||
this.emitChange("status");
|
||||
}
|
||||
|
||||
showKeySetup(): void {
|
||||
if (this._status === Status.Setup) {
|
||||
this._setupKeyType = KeyType.Passphrase;
|
||||
this.emitChange("setupKeyType");
|
||||
}
|
||||
}
|
||||
|
||||
get setupKeyType(): KeyType {
|
||||
return this._setupKeyType;
|
||||
this._setupKeyType = KeyType.RecoveryKey;
|
||||
this.emitChange("status");
|
||||
}
|
||||
|
||||
private async _enterCredentials(keyType, credential, setupDehydratedDevice): Promise<void> {
|
||||
|
@ -27,14 +27,8 @@ export class KeyBackupSettingsView extends TemplateView<KeyBackupViewModel> {
|
||||
switch (status) {
|
||||
case Status.Enabled: return renderEnabled(t, vm);
|
||||
case Status.NewVersionAvailable: return renderNewVersionAvailable(t, vm);
|
||||
case Status.Setup: {
|
||||
if (vm.setupKeyType === KeyType.Passphrase) {
|
||||
return renderEnableFromPhrase(t, vm);
|
||||
} else {
|
||||
return renderEnableFromKey(t, vm);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Status.SetupWithPassphrase: return renderEnableFromPhrase(t, vm);
|
||||
case Status.SetupWithRecoveryKey: return renderEnableFromKey(t, vm);
|
||||
case Status.Pending: return t.p(vm.i18n`Waiting to go online…`);
|
||||
}
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user