MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / loadConnection

Function loadConnection

devtools/modules/connectionStorageManager.js:65–81  ·  view source on GitHub ↗
(savedId)

Source from the content-addressed store, hash-verified

63}
64
65export async function loadConnection(savedId) {
66 const database = await initDB();
67 return new Promise((resolve, reject) => {
68 const transaction = database.transaction([STORE_NAME], 'readonly');
69 const store = transaction.objectStore(STORE_NAME);
70 const request = store.get(savedId);
71
72 request.onsuccess = () => {
73 if (request.result) {
74 resolve(request.result);
75 } else {
76 resolve(null);
77 }
78 };
79 request.onerror = () => reject(request.error);
80 });
81}
82
83export async function deleteConnection(savedId) {
84 const database = await initDB();

Callers 1

loadSavedConnectionFunction · 0.90

Calls 1

initDBFunction · 0.70

Tested by

no test coverage detected