Skip to content

Commit

Permalink
bugfix(fe): Search page freezing on loading state for tabs with 0 ent…
Browse files Browse the repository at this point in the history
…ities (#1587)
  • Loading branch information
AndreyNenashev committed Jan 18, 2024
1 parent 528e018 commit 8ea9d90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions odd-platform-ui/src/components/Search/Results/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Results: React.FC = () => {
const searchResults = useAppSelector(getSearchResults);
const searchResultsError = useAppSelector(getSearchResultsError);
const searchFiltersSynced = useAppSelector(getSearchFacetsSynced);
const { total, page, hasNext } = useAppSelector(getSearchResultsPageInfo);
const { page, hasNext } = useAppSelector(getSearchResultsPageInfo);

const isSearchFetching = useAppSelector(getSearchIsFetching);
const isSearchCreatingAndFetching = useAppSelector(getSearchIsCreatingAndFetching);
Expand Down Expand Up @@ -160,7 +160,7 @@ const Results: React.FC = () => {
</InfiniteScroll>
<EmptyContentPlaceholder
isContentLoaded={!isSearchFetching}
isContentEmpty={!total}
isContentEmpty={!searchResults.length}
text={t('No matches found')}
/>
</S.ListContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,19 @@ export const getSearchIsFetching = createSelector(
getSearchUpdateStatuses,
getSearchResultsFetchStatuses,
getSearchFacetsSynced,
searchState,
(
{ isLoading: isSearchCreating },
{ isLoading: isSearchFetching },
{ isLoading: isSearchUpdating },
{ isLoading: isSearchResultsFetching },
isSynced,
search
isSynced
) =>
compact([
isSearchCreating,
isSearchFetching,
isSearchUpdating,
isSearchResultsFetching,
]).length > 0 ||
!isSynced ||
(!!search.results.pageInfo.total && !search.results.items.length)
]).length > 0 || !isSynced
);

export const getSearchIsCreatingAndFetching = createSelector(
Expand Down

0 comments on commit 8ea9d90

Please sign in to comment.