From 36522a1561c07edf6ec84cf92bac2ca40ad5a34a Mon Sep 17 00:00:00 2001 From: Suraj Elapully Date: Wed, 21 Aug 2019 12:05:02 +0530 Subject: [PATCH] if this line isnt there, the app is never adding fingerids to sharedpreferences --- .../fingerprintChange/RNFingerprintChangeModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/toyberman/fingerprintChange/RNFingerprintChangeModule.java b/android/src/main/java/com/toyberman/fingerprintChange/RNFingerprintChangeModule.java index 8c072e5..1dc7a2b 100644 --- a/android/src/main/java/com/toyberman/fingerprintChange/RNFingerprintChangeModule.java +++ b/android/src/main/java/com/toyberman/fingerprintChange/RNFingerprintChangeModule.java @@ -80,12 +80,12 @@ public void hasFingerPrintChanged(Callback errorCallback, Callback successCallba // last saved key int lastKeyId = spref.getInt(LAST_KEY_ID, -1); if (lastKeyId != fingersId && lastKeyId!= -1) { - spref.edit().putInt(LAST_KEY_ID, fingersId).apply(); successCallback.invoke(true); - } else { successCallback.invoke(false); } + if(lastKeyId==-1) + spref.edit().putInt(LAST_KEY_ID, fingersId).apply(); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { successCallback.invoke(false); } @@ -120,4 +120,4 @@ public String getName() { return "RNFingerprintChange"; } -} \ No newline at end of file +}