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`
|
||||
*/
|
||||
export function canImplyAuthentication(options?: Options): Promise {
|
||||
if (RNKeychainManager.canCheckAuthentication) {
|
||||
return Promise.reject(
|
||||
new Error(`canImplyAuthentication() is not supported on this platform`)
|
||||
);
|
||||
if (!RNKeychainManager.canCheckAuthentication) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
return RNKeychainManager.canCheckAuthentication(options);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue