From cb3ea92d63399966be9bed14083d106679817bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Tue, 14 Oct 2025 15:03:57 +0200 Subject: [PATCH] pl-fe: fix search loading state display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/columns/search.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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}