From 074d1ded2208dd30d1b7755d00f00fdf498a541c Mon Sep 17 00:00:00 2001 From: Thiago Porto Date: Thu, 25 Mar 2021 17:21:01 -0300 Subject: [PATCH] Cleaning prompt on authcallback to avoid errors --- .../hieuvp/fingerprint/ReactNativeFingerprintScannerModule.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/src/main/java/com/hieuvp/fingerprint/ReactNativeFingerprintScannerModule.java b/android/src/main/java/com/hieuvp/fingerprint/ReactNativeFingerprintScannerModule.java index fd3a6f6c..bd977a7f 100644 --- a/android/src/main/java/com/hieuvp/fingerprint/ReactNativeFingerprintScannerModule.java +++ b/android/src/main/java/com/hieuvp/fingerprint/ReactNativeFingerprintScannerModule.java @@ -83,12 +83,14 @@ public AuthCallback(final Promise promise) { @Override public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) { + biometricPrompt = null; super.onAuthenticationError(errorCode, errString); this.promise.reject(biometricPromptErrName(errorCode), TYPE_BIOMETRICS); } @Override public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) { + biometricPrompt = null; super.onAuthenticationSucceeded(result); this.promise.resolve(true); }