Fix backup restore after captcha navigation bug.

This commit is contained in:
Cody Henthorne
2025-11-20 12:03:24 -05:00
parent cc3919244b
commit 25481b7408
2 changed files with 13 additions and 0 deletions

View File

@@ -248,6 +248,18 @@ class RegistrationViewModel : ViewModel() {
}
}
fun clearPreviousRegistrationState() {
store.update {
it.copy(
sessionId = null,
captchaToken = null,
challengesRequested = emptyList(),
challengeInProgress = false,
fcmToken = null
)
}
}
fun onBackupSuccessfullyRestored() {
val recoveryPassword = SignalStore.svr.recoveryPassword
store.update {

View File

@@ -81,6 +81,7 @@ class SelectManualRestoreMethodFragment : ComposeFragment() {
private fun startRestoreMethod(method: RestoreMethod) {
when (method) {
RestoreMethod.FROM_SIGNAL_BACKUPS -> {
sharedViewModel.clearPreviousRegistrationState()
sharedViewModel.intendToRestore(hasOldDevice = false, fromRemote = true)
findNavController().safeNavigate(SelectManualRestoreMethodFragmentDirections.goToEnterPhoneNumber(EnterPhoneNumberMode.COLLECT_FOR_MANUAL_SIGNAL_BACKUPS_RESTORE))
}