Skip to content

Commit 26365a4

Browse files
Fix empty initial markdown cache on single-file folder open
1 parent 29081ee commit 26365a4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

web/src/App.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,11 @@
686686
687687
rawMarkdown = init.markdown ?? '';
688688
structure = init.structure ?? emptyPlanStructure();
689-
if (init.filePath && detectFileType(init.filePath) === 'markdown' && typeof init.markdown === 'string') {
690-
markdownCacheByPath.set(init.filePath, init.markdown);
689+
const initialMarkdown = typeof init.markdown === 'string' && init.markdown.length > 0
690+
? init.markdown
691+
: null;
692+
if (init.filePath && detectFileType(init.filePath) === 'markdown' && initialMarkdown !== null) {
693+
markdownCacheByPath.set(init.filePath, initialMarkdown);
691694
if (typeof init.contentMtimeMs === 'number') {
692695
loadedMtimeByPath.set(init.filePath, init.contentMtimeMs);
693696
}

0 commit comments

Comments
 (0)