Skip to content

Commit

Permalink
fixed bounties per page bug in my refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ie2173 committed Sep 11, 2024
1 parent d0293d6 commit a3532f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/[netname]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import * as React from 'react';
import React from 'react';
import { ToastContainer } from 'react-toastify';

import 'react-toastify/dist/ReactToastify.css';
import { ToastContainer } from 'react-toastify';

import ContentHome from '@/components/layout/ContentHome';
import CreateBounty from '@/components/ui/CreateBounty';
Expand Down
6 changes: 3 additions & 3 deletions src/components/layout/ContentHome.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use-client';

import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { usePathname } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useGetChain } from '@/hooks';

import { cn } from '@/lib';
import { useGetChain } from '@/hooks';
import { BountyList } from '@/components/ui';
import { fetchBounties, getContractRead } from '@/app/context';
import { BlacklistedBounties, PAGE_SIZE } from '@/constant/';
Expand Down Expand Up @@ -104,7 +104,7 @@ const ContentHome = () => {
const contractRead = await getContractRead();
const bountyCounter = await contractRead.bountyCounter();
const totalBounties = Number(bountyCounter.toString());
const data = await fetchBounties(-PAGE_SIZE, PAGE_SIZE);
const data = await fetchBounties(totalBounties - PAGE_SIZE, PAGE_SIZE);

setBountiesData(
data.sort((a, b) => Number(b.createdAt) - Number(a.createdAt))
Expand Down

0 comments on commit a3532f8

Please sign in to comment.