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 +}