mirror of
https://github.com/status-im/react-native-keychain.git
synced 2025-03-02 22:00:45 +00:00
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…
x
Reference in New Issue
Block a user