@@ -29,6 +29,9 @@ import org.thoughtcrime.securesms.MainActivity
2929import org.thoughtcrime.securesms.PassphraseRequiredActivity
3030import org.thoughtcrime.securesms.R
3131import org.thoughtcrime.securesms.RestoreDirections
32+ import org.thoughtcrime.securesms.keyvalue.SignalStore
33+ import org.thoughtcrime.securesms.keyvalue.isWantingManualRemoteRestore
34+ import org.thoughtcrime.securesms.registration.ui.restore.RemoteRestoreActivity
3235import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme
3336import org.thoughtcrime.securesms.util.TextSecurePreferences
3437import org.thoughtcrime.securesms.util.navigation.safeNavigate
@@ -74,21 +77,27 @@ class RestoreActivity : BaseActivity() {
7477 when (navTarget) {
7578 NavTarget .NEW_LANDING -> {
7679 if (sharedViewModel.hasNoRestoreMethods()) {
77- Log .i(TAG , " No restore methods available, skipping" )
78- sharedViewModel.skipRestore()
80+ if (SignalStore .registration.restoreDecisionState.isWantingManualRemoteRestore) {
81+ Log .i(TAG , " User has no available restore methods but previously wanted a remote restore, navigating immediately." )
82+ startActivity(RemoteRestoreActivity .getIntent(this , isOnlyOption = true ))
83+ } else {
84+ Log .i(TAG , " No restore methods available, skipping" )
85+ sharedViewModel.skipRestore()
7986
80- val nextIntent = sharedViewModel.getNextIntent()
87+ val nextIntent = sharedViewModel.getNextIntent()
8188
82- if (nextIntent != null ) {
83- Log .d(TAG , " Launching ${nextIntent.component} " )
84- startActivity(nextIntent)
85- } else {
86- startActivity(MainActivity .clearTop(this ))
89+ if (nextIntent != null ) {
90+ Log .d(TAG , " Launching ${nextIntent.component} " )
91+ startActivity(nextIntent)
92+ } else {
93+ startActivity(MainActivity .clearTop(this ))
94+ }
8795 }
8896
8997 supportFinishAfterTransition()
9098 }
9199 }
100+
92101 NavTarget .LOCAL_RESTORE -> navController.safeNavigate(RestoreDirections .goDirectlyToChooseLocalBackup())
93102 NavTarget .TRANSFER -> navController.safeNavigate(RestoreDirections .goDirectlyToDeviceTransfer())
94103 }
0 commit comments