From 9569c3432430f5675e9d259024c4b229cb1a7a50 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 9 May 2023 13:50:45 +0200 Subject: [PATCH] Do not repeat the recovery setup. Should fix issue reported at https://github.com/vector-im/element-android/pull/8165#issuecomment-1533212264 --- .../main/java/im/vector/app/features/home/HomeActivity.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 872f3f6dd5..42eb200887 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -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) + } } }