From 0c52a7ed040c5637d81c408e2ec41197de4b2563 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Tue, 18 Oct 2022 15:45:39 +0300 Subject: [PATCH] Fix layout after try again button is clicked. --- .../im/vector/app/features/login/qr/QrCodeLoginActivity.kt | 3 ++- .../im/vector/app/features/login/qr/QrCodeLoginViewModel.kt | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginActivity.kt b/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginActivity.kt index c9b8ae00804..a0c113224d0 100644 --- a/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginActivity.kt +++ b/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginActivity.kt @@ -24,6 +24,7 @@ import com.airbnb.mvrx.Mavericks import com.airbnb.mvrx.viewModel import dagger.hilt.android.AndroidEntryPoint import im.vector.app.core.extensions.addFragment +import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.SimpleFragmentActivity import im.vector.app.features.home.HomeActivity import im.vector.lib.core.utils.compat.getParcelableCompat @@ -66,7 +67,7 @@ class QrCodeLoginActivity : SimpleFragmentActivity() { } private fun showInstructionsFragment(qrCodeLoginArgs: QrCodeLoginArgs) { - addFragment( + replaceFragment( views.container, QrCodeLoginInstructionsFragment::class.java, qrCodeLoginArgs, diff --git a/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginViewModel.kt b/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginViewModel.kt index 9bf3e955d3e..97cca9d7918 100644 --- a/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/login/qr/QrCodeLoginViewModel.kt @@ -59,6 +59,11 @@ class QrCodeLoginViewModel @AssistedInject constructor( } private fun handleTryAgain() { + setState { + copy( + connectionStatus = null + ) + } _viewEvents.post(QrCodeLoginViewEvents.NavigateToInitialScreen) }