Skip to content

Commit 1a28acd

Browse files
committed
Bugfixes
1 parent 6287a1f commit 1a28acd

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/hooks/useCreateFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const useCreateFile = () => {
217217
const { frontmatterPanelVisible, toggleFrontmatterPanel } =
218218
useUIStore.getState()
219219

220-
openFile(newFile)
220+
await openFile(newFile)
221221

222222
// Open frontmatter panel if we have a title field
223223
if (hasTitleField && !frontmatterPanelVisible) {

src/lib/project-registry/index.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,24 @@ export class ProjectRegistryManager {
232232
},
233233
}
234234

235-
// Update defaultFileType if provided
236-
if (settings.defaultFileType !== undefined) {
237-
projectData.settings.defaultFileType = settings.defaultFileType
235+
// Update defaultFileType if property is present
236+
if ('defaultFileType' in settings) {
237+
if (settings.defaultFileType === undefined) {
238+
// Remove the override to inherit from global settings
239+
delete projectData.settings.defaultFileType
240+
} else {
241+
projectData.settings.defaultFileType = settings.defaultFileType
242+
}
238243
}
239244

240-
// Update collections if provided
241-
if (settings.collections !== undefined) {
242-
projectData.settings.collections = settings.collections
245+
// Update collections if property is present
246+
if ('collections' in settings) {
247+
if (settings.collections === undefined) {
248+
// Remove the override
249+
delete projectData.settings.collections
250+
} else {
251+
projectData.settings.collections = settings.collections
252+
}
243253
}
244254

245255
// Update cache

0 commit comments

Comments
 (0)