Do not repeat the recovery setup.

Should fix issue reported at https://github.com/vector-im/element-android/pull/8165#issuecomment-1533212264
This commit is contained in:
Benoit Marty 2023-05-09 13:50:45 +02:00
parent 8b7601029b
commit 9569c34324
1 changed files with 4 additions and 3 deletions

View File

@ -30,9 +30,8 @@ import androidx.core.view.isVisible
import androidx.drawerlayout.widget.DrawerLayout
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.withResumed
import com.airbnb.mvrx.Mavericks
import com.airbnb.mvrx.viewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@ -402,7 +401,9 @@ class HomeActivity :
private fun handleStartRecoverySetup() {
// To avoid IllegalStateException in case the transaction was executed after onSaveInstanceState
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) { navigator.open4SSetup(this@HomeActivity, SetupMode.NORMAL) }
withResumed {
navigator.open4SSetup(this@HomeActivity, SetupMode.NORMAL)
}
}
}