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

Function findWindowForVaultRoot

apps/desktop/src/main/index.ts:424–432  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

422}
423
424function findWindowForVaultRoot(root: string): BrowserWindow | null {
425 const target = path.resolve(root)
426 for (const win of BrowserWindow.getAllWindows()) {
427 if (win.isDestroyed() || !isWorkspaceWindow(win)) continue
428 const vault = windowVaults.vaultForWindow(win.id)
429 if (vault && path.resolve(vault.root) === target) return win
430 }
431 return null
432}
433
434function queueMarkdownFileOpen(rawPath: string, reuseMainWindow: boolean): void {
435 pendingFileOpens.push({ absPath: path.resolve(rawPath), reuseMainWindow })

Callers 2

openMarkdownFileFromOSFunction · 0.85
registerIpcFunction · 0.85

Calls 2

isWorkspaceWindowFunction · 0.85
vaultForWindowMethod · 0.80

Tested by

no test coverage detected