fixed empty filter error

This commit is contained in:
Annika Hannig 2022-07-25 17:59:36 +02:00
parent 3b6c76a37f
commit 0d5f2f9484

View File

@ -19,6 +19,7 @@ import ButtonRemoveFilter
import BgpCommunityLabel
from 'app/components/routes/BgpCommunityLabel';
const AppliedCommunity = ({group, filter, onRemove}) => {
const removeFilter = useCallback(() => {
onRemove([group, filter.value]);
@ -39,6 +40,10 @@ const AppliedCommunity = ({group, filter, onRemove}) => {
const createCommunityOption = (group) => ({filter}) => {
const name = useReadableCommunity(filter.value);
if (filter.value.length === 0) {
return null;
}
const cls = `select-bgp-community-0-${filter.value[0]} ` +
`select-bgp-community-1-${filter.value[1]} ` +
`select-bgp-community-2-${filter.value[2]}`;