()
| 21 | }; |
| 22 | |
| 23 | async function fetchNativeKeychainCredentials(): Promise<?UserCredentials> { |
| 24 | if (storedNativeKeychainCredentials.state === 'determined') { |
| 25 | return storedNativeKeychainCredentials.credentials; |
| 26 | } |
| 27 | try { |
| 28 | const result = await getInternetCredentials('comm.app'); |
| 29 | const credentials = result |
| 30 | ? { username: result.username, password: result.password } |
| 31 | : undefined; |
| 32 | storedNativeKeychainCredentials = { state: 'determined', credentials }; |
| 33 | return credentials; |
| 34 | } catch (e) { |
| 35 | const credentials = null; |
| 36 | storedNativeKeychainCredentials = { state: 'unsupported', credentials }; |
| 37 | return credentials; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | async function fetchNativeCredentials(): Promise<?UserCredentials> { |
| 42 | const keychainCredentials = await fetchNativeKeychainCredentials(); |
no outgoing calls
no test coverage detected