MCPcopy Create free account
hub / github.com/BootBoi/android-app / insertOrUpdateConnection

Function insertOrUpdateConnection

src/Connection/ConnectionStoreHelper.ts:32–41  ·  view source on GitHub ↗
(connection: Connection)

Source from the content-addressed store, hash-verified

30}
31
32export 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
43export async function deleteConnection(connection: Connection) {
44 const storedConnections = await getStoredConnections();

Callers 1

onSaveFunction · 0.90

Calls 2

getStoredConnectionsFunction · 0.85
getIndexOfConnectionFunction · 0.85

Tested by

no test coverage detected