mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-04 00:08:35 +00:00
Ensure username is reclaimed after account restore.
This commit is contained in:
@@ -156,7 +156,6 @@ object SvrRepository {
|
||||
SignalStore.svr.isRegistrationLockEnabled = false
|
||||
SignalStore.pin.resetPinReminders()
|
||||
SignalStore.svr.isPinForgottenOrSkipped = false
|
||||
SignalStore.storageService.setNeedsAccountRestore(false)
|
||||
SignalStore.pin.keyboardType = pinKeyboardType
|
||||
SignalStore.storageService.setNeedsAccountRestore(false)
|
||||
|
||||
|
||||
@@ -827,26 +827,25 @@ class RegistrationViewModel : ViewModel() {
|
||||
|
||||
if (reglockEnabled) {
|
||||
SignalStore.onboarding.clearAll()
|
||||
val stopwatch = Stopwatch("RegistrationLockRestore")
|
||||
}
|
||||
|
||||
if (reglockEnabled || SignalStore.storageService.lastSyncTime == 0L) {
|
||||
val stopwatch = Stopwatch("post-reg-storage-service")
|
||||
|
||||
AppDependencies.jobManager.runSynchronously(StorageAccountRestoreJob(), StorageAccountRestoreJob.LIFESPAN)
|
||||
stopwatch.split("AccountRestore")
|
||||
stopwatch.split("account-restore")
|
||||
|
||||
AppDependencies.jobManager
|
||||
.startChain(StorageSyncJob())
|
||||
.then(ReclaimUsernameAndLinkJob())
|
||||
.enqueueAndBlockUntilCompletion(TimeUnit.SECONDS.toMillis(10))
|
||||
stopwatch.split("ContactRestore")
|
||||
|
||||
refreshRemoteConfig()
|
||||
|
||||
stopwatch.split("RemoteConfig")
|
||||
stopwatch.split("storage-sync")
|
||||
|
||||
stopwatch.stop(TAG)
|
||||
} else {
|
||||
refreshRemoteConfig()
|
||||
}
|
||||
|
||||
refreshRemoteConfig()
|
||||
|
||||
store.update {
|
||||
it.copy(
|
||||
registrationCheckpoint = RegistrationCheckpoint.LOCAL_REGISTRATION_COMPLETE,
|
||||
|
||||
Reference in New Issue
Block a user