()
| 535 | } |
| 536 | |
| 537 | function createInitialState() { |
| 538 | const ts = nowIso(); |
| 539 | const { id, pack } = getTemplatePackOrThrow(DEFAULT_TEMPLATE_PACK); |
| 540 | return { |
| 541 | sections: pack.sections.map((section) => ({ |
| 542 | ...section, |
| 543 | status: "Not Started", |
| 544 | notes: [], |
| 545 | content: cloneJson(pack.defaultContent?.[section.id] || {}), |
| 546 | filesChanged: [], |
| 547 | lastModified: ts, |
| 548 | })), |
| 549 | templatePackId: id, |
| 550 | fieldSuggestions: cloneJson(pack.fieldSuggestions || {}), |
| 551 | sectionSchemas: cloneJson(pack.sectionSchemas || {}), |
| 552 | changeLog: [], |
| 553 | contentProposals: [], |
| 554 | milestones: [], |
| 555 | theme: { style: "dark", palette: "#050A14/#2F80ED" }, |
| 556 | branch: readBranchFromGit(), |
| 557 | lastUpdated: ts, |
| 558 | }; |
| 559 | } |
| 560 | |
| 561 | let persistQueue = Promise.resolve(); |
| 562 | function persistState() { |
no test coverage detected