Skip to content

Commit e3e7d5c

Browse files
committed
fix(web): incorrect-locked-pnk-display-in-dashboard
1 parent 7d866c7 commit e3e7d5c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

web/src/pages/Dashboard/Courts/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Skeleton from "react-loading-skeleton";
66
import CourtCard from "./CourtCard";
77
import Header from "./Header";
88
import { useJurorStakeDetailsQuery } from "queries/useJurorStakeDetailsQuery";
9+
import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated";
910

1011
const Container = styled.div`
1112
margin-top: 64px;
@@ -31,13 +32,16 @@ const StyledLabel = styled.label`
3132
const Courts: React.FC = () => {
3233
const { address } = useAccount();
3334
const { data: stakeData, isLoading } = useJurorStakeDetailsQuery(address?.toLowerCase() as `0x${string}`);
35+
const { data: jurorBalance } = useSortitionModuleGetJurorBalance({
36+
args: [address as `0x${string}`, BigInt(1)],
37+
});
3438
const stakedCourts = stakeData?.jurorTokensPerCourts?.filter(({ staked }) => staked > 0);
3539
const isStaked = stakedCourts && stakedCourts.length > 0;
36-
const lockedStake = stakeData?.jurorTokensPerCourts?.[0]?.locked;
40+
const lockedStake = jurorBalance?.[1].toString();
3741

3842
return (
3943
<Container>
40-
<Header lockedStake={lockedStake} />
44+
<Header lockedStake={lockedStake ?? ""} />
4145
{isLoading ? <Skeleton /> : null}
4246
{!isStaked && !isLoading ? <StyledLabel>You are not staked in any court</StyledLabel> : null}
4347
{isStaked && !isLoading ? (

0 commit comments

Comments
 (0)