Resolve with false instead of throwing for platforms that can't imply authentication
This commit is contained in:
parent
add90c5769
commit
c2cc3285b7
6
index.js
6
index.js
|
@ -68,10 +68,8 @@ type Options = {
|
||||||
* @return {Promise} Resolves to `true` when supported, otherwise `false`
|
* @return {Promise} Resolves to `true` when supported, otherwise `false`
|
||||||
*/
|
*/
|
||||||
export function canImplyAuthentication(options?: Options): Promise {
|
export function canImplyAuthentication(options?: Options): Promise {
|
||||||
if (RNKeychainManager.canCheckAuthentication) {
|
if (!RNKeychainManager.canCheckAuthentication) {
|
||||||
return Promise.reject(
|
return Promise.resolve(false);
|
||||||
new Error(`canImplyAuthentication() is not supported on this platform`)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return RNKeychainManager.canCheckAuthentication(options);
|
return RNKeychainManager.canCheckAuthentication(options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue