Tweak the onboarding flow identity confirmation screen

- hide the recovery key option if recovery wasn't set up beforehand
- add a button to present the reset encryption instructions screen
This commit is contained in:
Stefan Ceriu
2024-05-24 13:57:40 +03:00
committed by Stefan Ceriu
parent f8d094516d
commit 696d599773
9 changed files with 45 additions and 24 deletions
@@ -71,23 +71,23 @@ struct IdentityConfirmationScreen: View {
@ViewBuilder
private var actionButtons: some View {
VStack(spacing: 32) {
switch context.viewState.mode {
case .recoveryOnly:
Button(L10n.screenSessionVerificationEnterRecoveryKey) {
context.send(viewAction: .recoveryKey)
}
.buttonStyle(.compound(.primary))
case .recoveryAndVerification:
if context.viewState.availableActions.contains(.interactiveVerification) {
Button(L10n.actionStartVerification) {
context.send(viewAction: .otherDevice)
}
.buttonStyle(.compound(.primary))
if context.viewState.availableActions.contains(.recovery) {
Button(L10n.screenSessionVerificationEnterRecoveryKey) {
context.send(viewAction: .recoveryKey)
}
.buttonStyle(.compound(.plain))
}
} else if context.viewState.availableActions.contains(.recovery) {
Button(L10n.screenSessionVerificationEnterRecoveryKey) {
context.send(viewAction: .recoveryKey)
}
.buttonStyle(.compound(.plain))
.buttonStyle(.compound(.primary))
}
if shouldShowSkipButton {
@@ -96,6 +96,11 @@ struct IdentityConfirmationScreen: View {
}
.buttonStyle(.compound(.plain))
}
Button(L10n.screenRecoveryKeyConfirmLostRecoveryKey, role: .destructive) {
context.send(viewAction: .reset)
}
.buttonStyle(.compound(.plain))
}
}
}