MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / emptyTrash

Function emptyTrash

apps/desktop/src/main/vault.ts:3248–3261  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

3246}
3247
3248export async function emptyTrash(root: string): Promise<void> {
3249 const trashDir = path.join(root, 'trash')
3250 try {
3251 const entries = await fs.readdir(trashDir)
3252 await Promise.all(entries.map((e) => removeNoteComments(root, `trash/${e}`)))
3253 await Promise.all(
3254 entries.map((e) => fs.rm(path.join(trashDir, e), { recursive: true, force: true }))
3255 )
3256 invalidateNoteMetaCache(root)
3257 invalidateVaultTextSearchCache(root)
3258 } catch {
3259 /* no trash dir yet */
3260 }
3261}
3262
3263export async function deleteNote(root: string, rel: string): Promise<void> {
3264 const abs = resolveSafe(root, rel)

Callers 1

registerIpcFunction · 0.90

Calls 3

removeNoteCommentsFunction · 0.85
invalidateNoteMetaCacheFunction · 0.85

Tested by

no test coverage detected