(rawPath: string, reuseMainWindow: boolean)
| 432 | } |
| 433 | |
| 434 | function 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 | |
| 444 | function handleStartupMarkdownArgs(argv: string[], reuseMainWindow: boolean): void { |
| 445 | for (const candidate of markdownPathsFromArgv(argv)) { |
no test coverage detected