fix: customize icon & color works for types without Type entry (#173)
Types without a dedicated Type definition note in the vault silently failed to save icon/color customizations. Both applyCustomization (Sidebar) and handleCustomizeType (useEntryActions) returned early when no Type entry existed. Also fixed a race condition where two concurrent handleUpdateFrontmatter calls could overwrite each other. Changes: - useNoteActions: add createTypeEntrySilent for headless Type file creation - useEntryActions: auto-create Type entry when missing, serialize writes - Sidebar: applyCustomization proceeds with defaults when no Type entry - App: wire createTypeEntrySilent into useEntryActions config Co-authored-by: Test <test@test.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -151,8 +151,9 @@ function applyCustomization(
|
||||
): void {
|
||||
if (!target || !onCustomizeType) return
|
||||
const te = typeEntryMap[target]
|
||||
if (!te) return
|
||||
const [icon, color] = buildCustomizeArgs(te, prop, value)
|
||||
const [icon, color] = te
|
||||
? buildCustomizeArgs(te, prop, value)
|
||||
: [prop === 'icon' ? value : 'file-text', prop === 'color' ? value : 'blue']
|
||||
onCustomizeType(target, icon, color)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user