diff --git a/packages/pl-fe/src/columns/search.tsx b/packages/pl-fe/src/columns/search.tsx index 863bd1f51..bce85b724 100644 --- a/packages/pl-fe/src/columns/search.tsx +++ b/packages/pl-fe/src/columns/search.tsx @@ -60,8 +60,7 @@ const SearchColumn: React.FC = ({ type, query, accountId, multiCo const handleLoadMore = () => activeQuery.fetchNextPage({ cancelRefetch: false }); let searchResults; - const hasMore = activeQuery.hasNextPage; - const isLoading = activeQuery.isFetching; + const { hasNextPage: hasMore, isFetching, isLoading } = activeQuery; let placeholderComponent = PlaceholderStatus; let resultsIds: Array; @@ -72,7 +71,7 @@ const SearchColumn: React.FC = ({ type, query, accountId, multiCo if (searchAccountsQuery.data && searchAccountsQuery.data.length > 0) { resultsIds = searchAccountsQuery.data; searchResults = searchAccountsQuery.data.map(accountId => ); - } else if (!isLoading) { + } else if (!isFetching) { return (
= ({ type, query, accountId, multiCo if (searchStatusesQuery.data && searchStatusesQuery.data.length > 0) { resultsIds = searchStatusesQuery.data; searchResults = searchStatusesQuery.data.map(statusId => ); - } else if (!isLoading) { + } else if (!isFetching) { return (
= ({ type, query, accountId, multiCo if (searchHashtagsQuery.data && searchHashtagsQuery.data.length > 0) { resultsIds = searchHashtagsQuery.data.map(hashtag => hashtag.name); searchResults = searchHashtagsQuery.data.map(hashtag => ); - } else if (!isLoading) { + } else if (!isFetching) { return (
= ({ type, query, accountId, multiCo ref={node} id='search-results' key={type} - isLoading={!!query && isLoading} + isLoading={!!query && isFetching} showLoading={isLoading} hasMore={hasMore} onLoadMore={handleLoadMore}