Skip to content

Commit

Permalink
add pages length check
Browse files Browse the repository at this point in the history
  • Loading branch information
GeronimoJohn committed Jan 17, 2025
1 parent 9702723 commit ab23e68
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ const StoreSearchComponent = ({
filter,
});

const pageNumber = data?.pages[data?.pages.length - 1]?.pageNumber ?? 0;
const pageNumber = data?.pages?.length
? (data.pages[data.pages.length - 1]?.pageNumber ?? 0)
: 0;

const debounceOnFilter = useDebounceCallback(
(searchText: string) => {
Expand Down

0 comments on commit ab23e68

Please sign in to comment.