diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa80a4d..742515a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ directly impact users rather than highlighting other key architectural updates.* ### Added - Proper ZEC amount abbreviation has been added across the entire app as described by the design document +### Fixed +- The app authentication now correctly handles authentication success after a previous failed state + ## [1.1.2 (676)] - 2024-06-24 ### Fixed diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/Navigation.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/Navigation.kt index db75f6b6..84e52bc7 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/Navigation.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/Navigation.kt @@ -341,7 +341,7 @@ private fun MainActivity.ShowSystemAuthentication( setCheckedProperty(false) }, onFailed = { - setCheckedProperty(false) + // No action needed }, useCase = protectedUseCase ) diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/AuthenticationViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/AuthenticationViewModel.kt index 6e4148db..6ca6b17c 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/AuthenticationViewModel.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/AuthenticationViewModel.kt @@ -234,7 +234,7 @@ class AuthenticationViewModel( */ override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) { super.onAuthenticationSucceeded(result) - Twig.info { "Authentication successful: $result" } + Twig.info { "Authentication successful" } authenticationResult.value = AuthenticationResult.Success } diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/authentication/AndroidAuthentication.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/authentication/AndroidAuthentication.kt index 22f93927..14f497e5 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/authentication/AndroidAuthentication.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/authentication/AndroidAuthentication.kt @@ -140,7 +140,8 @@ private fun WrapDeleteWalletAuth( Twig.warn { "Authentication result: failed" } authenticationViewModel.resetAuthenticationResult() onFailed() - Toast.makeText(activity, activity.getString(R.string.authentication_toast_failed), Toast.LENGTH_LONG).show() + Toast.makeText(activity, activity.getString(R.string.authentication_toast_failed), Toast.LENGTH_SHORT) + .show() } is AuthenticationResult.Error -> { Twig.error { @@ -212,7 +213,7 @@ private fun WrapAppExportPrivateDataAuth( Twig.warn { "Authentication result: failed" } authenticationViewModel.resetAuthenticationResult() onFailed() - Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_LONG) + Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_SHORT) .show() } is AuthenticationResult.Error -> { @@ -285,7 +286,7 @@ private fun WrapSeedRecoveryAuth( Twig.warn { "Authentication result: failed" } authenticationViewModel.resetAuthenticationResult() onFailed() - Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_LONG) + Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_SHORT) .show() } is AuthenticationResult.Error -> { @@ -359,7 +360,7 @@ private fun WrapSendFundsAuth( Twig.warn { "Authentication result: failed" } authenticationViewModel.resetAuthenticationResult() onFailed() - Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_LONG) + Toast.makeText(activity, stringResource(id = R.string.authentication_toast_failed), Toast.LENGTH_SHORT) .show() } is AuthenticationResult.Error -> { @@ -432,7 +433,7 @@ private fun WrapAppAccessAuth( AuthenticationResult.Canceled -> { Twig.info { "Authentication result: canceled: shutting down" } authenticationViewModel.resetAuthenticationResult() - Toast.makeText(activity, stringResource(id = R.string.authentication_toast_canceled), Toast.LENGTH_LONG) + Toast.makeText(activity, stringResource(id = R.string.authentication_toast_canceled), Toast.LENGTH_SHORT) .show() onCancel() } diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/sendconfirmation/AndroidSendConfirmation.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/sendconfirmation/AndroidSendConfirmation.kt index ebfa4162..b234bfa1 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/sendconfirmation/AndroidSendConfirmation.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/sendconfirmation/AndroidSendConfirmation.kt @@ -228,12 +228,13 @@ internal fun WrapSendConfirmation( synchronizer = synchronizer, ) } + sendFundsAuthentication.value = false }, onCancel = { sendFundsAuthentication.value = false }, onFailed = { - sendFundsAuthentication.value = false + // No action needed }, useCase = AuthenticationUseCase.SendFunds )