mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
Fix: tag dropdown on no filtered tag avail
This commit is contained in:
@@ -145,14 +145,13 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
try {
|
||||
const metricsValue = sourceBlock.subBlocks?.metrics?.value as unknown as Metric[]
|
||||
if (Array.isArray(metricsValue)) {
|
||||
return {
|
||||
tags: metricsValue.map(
|
||||
(metric) => `${normalizedBlockName}.response.${metric.name.toLowerCase()}`
|
||||
),
|
||||
}
|
||||
return metricsValue.map(
|
||||
(metric) => `${normalizedBlockName}.response.${metric.name.toLowerCase()}`
|
||||
)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error parsing metrics:', e)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +222,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
}, [visible, selectedIndex, filteredTags])
|
||||
|
||||
// Don't render if not visible or no tags
|
||||
if (!visible || tags.length === 0) return null
|
||||
if (!visible || tags.length === 0 || filteredTags.length === 0) return null
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user