MCPcopy Create free account
hub / github.com/outerbase/studio / cleanupFileHandler

Function cleanupFileHandler

src/components/filehandler-picker.tsx:14–30  ·  view source on GitHub ↗

* Cleanup file handler from indexdb database when * it is no longer needed.

()

Source from the content-addressed store, hash-verified

12 * it is no longer needed.
13 */
14async function cleanupFileHandler() {
15 const validHandlerIds = new Set(
16 (await localDb.connection.toCollection().toArray())
17 .map((c) => c.content.file_handler)
18 .filter(Boolean) as string[]
19 );
20
21 const fileHandlerList = (await localDb.file_handler.toArray()).map(
22 (r) => r.id
23 );
24
25 for (const id of fileHandlerList) {
26 if (!validHandlerIds.has(id)) {
27 await localDb.file_handler.delete(id);
28 }
29 }
30}
31
32async function openFileHandler() {
33 const [newFileHandler] = await window.showOpenFilePicker({

Callers 1

FileHandlerPickerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected