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

Method dirHandler

apps/desktop/src/main/watcher.ts:110–117  ·  view source on GitHub ↗
(kind: VaultChangeKind)

Source from the content-addressed store, hash-verified

108 // surface it explicitly — otherwise another client sharing this vault
109 // (e.g. the web app) wouldn't see the folder until a manual refresh.
110 const dirHandler = (kind: VaultChangeKind) => (absPath: string) => {
111 if (!this.root) return
112 if (path.basename(absPath).startsWith('.')) return
113 const rel = toPosix(path.relative(this.root, absPath))
114 const folder = folderForRelativePath(rel)
115 if (!folder) return
116 onEvent({ kind, path: rel, folder, scope: 'folder' })
117 }
118
119 this.watcher
120 .on('add', handler('add'))

Callers

nothing calls this directly

Calls 2

folderForRelativePathFunction · 0.90
toPosixFunction · 0.70

Tested by

no test coverage detected