From c0eed20762ae68e7e3ad3bf4e4beef1e2b6d601d Mon Sep 17 00:00:00 2001 From: Maximilian Hagelstam Date: Wed, 22 May 2024 21:20:10 +0300 Subject: [PATCH] fix: add loading animation when changing feed sort option --- src/pages/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 6332b7d..edb8120 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -29,6 +29,7 @@ const Home: NextPage = () => { const { data, isLoading, + isRefetching, isError, fetchNextPage, hasNextPage, @@ -39,6 +40,7 @@ const Home: NextPage = () => { { keepPreviousData: true, getNextPageParam: (lastPage) => lastPage.nextCursor, + refetchOnWindowFocus: false, }, ); @@ -87,7 +89,7 @@ const Home: NextPage = () => { - {isLoading ? ( + {isLoading || isRefetching ? ( <> {Array(LIMIT) .fill(1)