File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments