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

Function flushPendingFileOpens

apps/desktop/src/main/index.ts:452–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

450// Returns true when at least one file produced (or focused) a window, so
451// the caller can skip opening a redundant default-vault window.
452async function flushPendingFileOpens(): Promise<boolean> {
453 if (!app.isReady() || pendingFileOpens.length === 0) return false
454 const items = pendingFileOpens.splice(0)
455 let openedAny = false
456 for (const item of items) {
457 try {
458 if (await openMarkdownFileFromOS(item.absPath, item.reuseMainWindow)) {
459 openedAny = true
460 }
461 } catch (err) {
462 console.error('Failed to open markdown file', item.absPath, err)
463 }
464 }
465 return openedAny
466}
467
468async function openMarkdownFileFromOS(absPath: string, reuseMainWindow: boolean): Promise<boolean> {
469 let stat

Callers 2

queueMarkdownFileOpenFunction · 0.85
index.tsFile · 0.85

Calls 1

openMarkdownFileFromOSFunction · 0.85

Tested by

no test coverage detected