From 04ff760d9377c399f2781719fb050ef51b9efa30 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Mon, 25 Sep 2023 10:34:05 -0300 Subject: [PATCH] - Navigate back on Loading screen when phone signer fails - Hide keyboard when the scanner reads a qr - Add 1 sec delay before calling checkHasAdmin --- .../main/java/chat/sphinx/signer_manager/SignerManagerImpl.kt | 2 ++ .../chat/sphinx/onboard_connect/ui/OnBoardConnectFragment.kt | 4 +++- .../chat/sphinx/onboard_connect/ui/OnBoardConnectViewModel.kt | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sphinx/activity/features/signer-manager/src/main/java/chat/sphinx/signer_manager/SignerManagerImpl.kt b/sphinx/activity/features/signer-manager/src/main/java/chat/sphinx/signer_manager/SignerManagerImpl.kt index 82650fcd34..b63617b905 100644 --- a/sphinx/activity/features/signer-manager/src/main/java/chat/sphinx/signer_manager/SignerManagerImpl.kt +++ b/sphinx/activity/features/signer-manager/src/main/java/chat/sphinx/signer_manager/SignerManagerImpl.kt @@ -27,6 +27,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import org.eclipse.paho.client.mqttv3.* @@ -702,6 +703,7 @@ class SignerManagerImpl( when (loadResponse) { is LoadResponse.Loading -> {} is Response.Error -> { + delay(1000L) checkHasAdmin(checkAdminCallback) } diff --git a/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectFragment.kt b/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectFragment.kt index a84c10fa83..8dc5a06e89 100644 --- a/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectFragment.kt +++ b/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectFragment.kt @@ -181,7 +181,9 @@ internal class OnBoardConnectFragment: SideEffectFragment< override suspend fun onSideEffectCollect(sideEffect: OnBoardConnectSideEffect) { if (sideEffect is OnBoardConnectSideEffect.FromScanner) { - binding.editTextCodeInput.setText(sideEffect.value.value) + val editTextCodeInput = binding.editTextCodeInput + editTextCodeInput.setText(sideEffect.value.value) + hideKeyboardFrom(editTextCodeInput.context, editTextCodeInput) } else { sideEffect.execute(binding.root.context) } diff --git a/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectViewModel.kt b/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectViewModel.kt index f8df1573a3..2d4e4bd4f7 100644 --- a/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectViewModel.kt +++ b/sphinx/screens/onboard/onboard-connect/src/main/java/chat/sphinx/onboard_connect/ui/OnBoardConnectViewModel.kt @@ -394,6 +394,7 @@ internal class OnBoardConnectViewModel @Inject constructor( app.getString(R.string.phone_signer_error) ) ) + mnemonicDialogViewStateContainer.updateViewState(MnemonicDialogViewState.Idle) } }