Files
aigen/server/api/library/index.get.ts
T
TowstyandCursor 845a037949 Make library hide/show instant on the grid and skip disk checks on browse.
The details pane keeps the real file so inspection is not delayed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 18:37:29 -05:00

13 lines
465 B
TypeScript

export default defineEventHandler((event) => {
const light = String(getQuery(event).light || '') === '1'
const library = publicLibrary(event, { light })
if (!light) {
try {
const { owner } = assertLibraryOwner(event)
const folderId = library.folders.find(folder => folder.unlocked)?.id
void maintainLibrary(owner, folderId).catch(() => null)
} catch { /* locked or anonymous — still return what we can */ }
}
return library
})