fix: tighten note icon typing
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user