Skip to content

Commit

Permalink
pass required args (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajaishwary authored and fkotsian committed Jan 28, 2020
1 parent 57556a4 commit 4a22b4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/authenticate.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import createError from './createError';

const { ReactNativeFingerprintScanner } = NativeModules;

const authCurrent = (description) => {
const authCurrent = (description, resolve, reject) => {
ReactNativeFingerprintScanner.authenticate(description)
.then(() => {
resolve(true);
Expand All @@ -18,7 +18,7 @@ const authCurrent = (description) => {
});
}

const authLegacy = (onAttempt) => {
const authLegacy = (onAttempt, resolve, reject) => {
DeviceEventEmitter.addListener('FINGERPRINT_SCANNER_AUTHENTICATION', (name) => {
if (name === 'AuthenticationNotMatch' && typeof onAttempt === 'function') {
onAttempt(createError(name));
Expand Down Expand Up @@ -48,9 +48,9 @@ export default ({ description, onAttempt }) => {
}

if (Platform.Version < 23) {
return authLegacy(onAttempt);
return authLegacy(onAttempt, resolve, reject);
}

return authCurrent(description);
return authCurrent(description, resolve, reject);
});
}

0 comments on commit 4a22b4d

Please sign in to comment.