fix: tighten note icon typing

This commit is contained in:
Test
2026-04-07 21:11:20 +02:00
parent 66a9127430
commit 2bc560468d
2 changed files with 5 additions and 3 deletions

View File

@@ -130,8 +130,10 @@ export function DynamicPropertiesPanel({
const handleFocusNoteIcon = () => {
const existingIconKey = propertyEntries.find(([key]) => key.toLowerCase() === 'icon')?.[0]
if (!existingIconKey && !onAddProperty) return
if (!existingIconKey) onAddProperty('icon', '')
if (!existingIconKey) {
if (!onAddProperty) return
onAddProperty('icon', '')
}
setEditingKey(existingIconKey ?? 'icon')
}

View File

@@ -18,7 +18,7 @@ function isHttpUrl(value: string): boolean {
}
}
export function hasNoteIconValue(icon: string | null | undefined): boolean {
export function hasNoteIconValue(icon: string | null | undefined): icon is string {
return typeof icon === 'string' && icon.trim().length > 0
}