Skip to content

Commit

Permalink
fix type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Sep 19, 2024
1 parent 3f9ba02 commit cc03263
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/global/FilterByCategory.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/jsx-key */
import {
Alert,
Box,
Expand Down Expand Up @@ -190,7 +191,10 @@ const FilterByCategory = ({
open={false}
value={selectedCategories}
onChange={(event, newValue) => {
setSelectedCategories(newValue);
const filteredCategories = newValue.filter(
(value): value is ICategory => typeof value !== 'string'
);
setSelectedCategories(filteredCategories);
}}
onInputChange={(event, value) => {
setSearchQuery(value);
Expand Down Expand Up @@ -258,7 +262,7 @@ const FilterByCategory = ({
className='mt-3 max-h-[300px] overflow-y-auto rounded-lg border border-gray-300'
onScroll={handleScroll}
>
{initialLoading ? ( // Only show the spinner on the first load
{initialLoading ? (
<Box className='flex justify-center py-8'>
<CircularProgress size={42} />
</Box>
Expand Down

0 comments on commit cc03263

Please sign in to comment.