Skip to content

Commit c3a55fe

Browse files
committed
Respect the methods setting
1 parent 4cc2daa commit c3a55fe

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSetupRecoveryKeyFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class BootstrapSetupRecoveryKeyFragment :
6666
views.bootstrapSetupSecureSubmit.isVisible = false
6767

6868
// Choose between create a passphrase or use a recovery key
69-
renderBackupMethodActions(firstFormStep.methods)
69+
renderBackupMethodActions(state.secureBackupMethod)
7070
}
7171
}
7272

vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
107107
copy(
108108
step = BootstrapStep.FirstForm(
109109
keyBackUpExist = false,
110-
reset = session.sharedSecretStorageService().isRecoverySetup(),
111-
methods = this.secureBackupMethod
110+
reset = session.sharedSecretStorageService().isRecoverySetup()
112111
)
113112
)
114113
}
@@ -134,7 +133,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
134133
// we just resume plain bootstrap
135134
doesKeyBackupExist = false
136135
setState {
137-
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod))
136+
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist))
138137
}
139138
} else {
140139
// we need to get existing backup passphrase/key and convert to SSSS
@@ -148,7 +147,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
148147
doesKeyBackupExist = true
149148
isBackupCreatedFromPassphrase = keyVersion.getAuthDataAsMegolmBackupAuthData()?.privateKeySalt != null
150149
setState {
151-
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod))
150+
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist))
152151
}
153152
}
154153
}
@@ -496,7 +495,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
496495
} else {
497496
setState {
498497
copy(
499-
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
498+
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
500499
// Also reset the passphrase
501500
passphrase = null,
502501
passphraseRepeat = null,
@@ -509,7 +508,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
509508
is BootstrapStep.SetupPassphrase -> {
510509
setState {
511510
copy(
512-
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
511+
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
513512
// Also reset the passphrase
514513
passphrase = null,
515514
passphraseRepeat = null
@@ -530,7 +529,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
530529
// Go back to the first step
531530
setState {
532531
copy(
533-
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
532+
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
534533
// Also reset the passphrase
535534
passphrase = null,
536535
passphraseRepeat = null
@@ -563,7 +562,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
563562
is BootstrapStep.GetBackupSecretForMigration -> {
564563
setState {
565564
copy(
566-
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
565+
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
567566
// Also reset the passphrase
568567
passphrase = null,
569568
passphraseRepeat = null,

vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ sealed class BootstrapStep {
9191
object CheckingMigration : BootstrapStep()
9292

9393
// Use will be asked to choose between passphrase or recovery key, or to start process if a key backup exists
94-
data class FirstForm(val keyBackUpExist: Boolean, val reset: Boolean = false, val methods: SecureBackupMethod) : BootstrapStep()
94+
data class FirstForm(val keyBackUpExist: Boolean, val reset: Boolean = false) : BootstrapStep()
9595

9696
object SetupPassphrase : BootstrapStep()
9797
object ConfirmPassphrase : BootstrapStep()

0 commit comments

Comments
 (0)