Skip to content

Commit

Permalink
fix: add loading animation when changing feed sort option
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianHagelstam committed May 22, 2024
1 parent 50bf3f7 commit c0eed20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Home: NextPage = () => {
const {
data,
isLoading,
isRefetching,
isError,
fetchNextPage,
hasNextPage,
Expand All @@ -39,6 +40,7 @@ const Home: NextPage = () => {
{
keepPreviousData: true,
getNextPageParam: (lastPage) => lastPage.nextCursor,
refetchOnWindowFocus: false,
},
);

Expand Down Expand Up @@ -87,7 +89,7 @@ const Home: NextPage = () => {
</div>
</div>
<PostsGrid>
{isLoading ? (
{isLoading || isRefetching ? (
<>
{Array(LIMIT)
.fill(1)
Expand Down

0 comments on commit c0eed20

Please sign in to comment.