(connection: Connection)
| 30 | } |
| 31 | |
| 32 | export async function insertOrUpdateConnection(connection: Connection) { |
| 33 | const storedConnections = await getStoredConnections(); |
| 34 | const index = getIndexOfConnection(storedConnections, connection); |
| 35 | if (index === -1) { |
| 36 | storedConnections.push(connection); |
| 37 | } else { |
| 38 | storedConnections[index] = connection; |
| 39 | } |
| 40 | await SecureStore.setItemAsync(STORE_KEY, JSON.stringify(storedConnections)); |
| 41 | } |
| 42 | |
| 43 | export async function deleteConnection(connection: Connection) { |
| 44 | const storedConnections = await getStoredConnections(); |
no test coverage detected