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

Function queueMarkdownFileOpen

apps/desktop/src/main/index.ts:434–442  ·  view source on GitHub ↗
(rawPath: string, reuseMainWindow: boolean)

Source from the content-addressed store, hash-verified

432}
433
434function queueMarkdownFileOpen(rawPath: string, reuseMainWindow: boolean): void {
435 pendingFileOpens.push({ absPath: path.resolve(rawPath), reuseMainWindow })
436 // Only flush eagerly once startup is finished. During startup `app.isReady()`
437 // is already true (we're inside whenReady), so an eager flush here would
438 // drain the queue before whenReady's own flush runs — that flush would then
439 // report "nothing opened" and open a redundant default window alongside the
440 // file's window, so `zen open` (and double-clicking a .md) opened two. (#178)
441 if (app.isReady() && appStartupComplete) void flushPendingFileOpens()
442}
443
444function handleStartupMarkdownArgs(argv: string[], reuseMainWindow: boolean): void {
445 for (const candidate of markdownPathsFromArgv(argv)) {

Callers 2

index.tsFile · 0.85

Calls 1

flushPendingFileOpensFunction · 0.85

Tested by

no test coverage detected