diff --git a/web/src/components/filter/ReviewFilterGroup.tsx b/web/src/components/filter/ReviewFilterGroup.tsx index e4eafb8df..2248835a2 100644 --- a/web/src/components/filter/ReviewFilterGroup.tsx +++ b/web/src/components/filter/ReviewFilterGroup.tsx @@ -593,40 +593,26 @@ export function GeneralFilterContent({
{allLabels.map((item) => ( -
- - { - if (isChecked) { - const updatedLabels = currentLabels - ? [...currentLabels] - : []; + { + if (isChecked) { + const updatedLabels = currentLabels ? [...currentLabels] : []; - updatedLabels.push(item); + updatedLabels.push(item); + setCurrentLabels(updatedLabels); + } else { + const updatedLabels = currentLabels ? [...currentLabels] : []; + + // can not deselect the last item + if (updatedLabels.length > 1) { + updatedLabels.splice(updatedLabels.indexOf(item), 1); setCurrentLabels(updatedLabels); - } else { - const updatedLabels = currentLabels - ? [...currentLabels] - : []; - - // can not deselect the last item - if (updatedLabels.length > 1) { - updatedLabels.splice(updatedLabels.indexOf(item), 1); - setCurrentLabels(updatedLabels); - } } - }} - /> -
+ } + }} + /> ))}