mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Fix backup restore after captcha navigation bug.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user