Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Sep 13, 2024
1 parent bc3f7a8 commit 3c02374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/components/Delegations/Delegations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const Delegations: React.FC<DelegationsProps> = ({
publicKeyNoCoord={publicKeyNoCoord}
delegationsAPI={delegationsAPI}
isWalletConnected={isWalletConnected}
address={address}
>
<DelegationsContent
delegationsAPI={delegationsAPI}
Expand Down
11 changes: 9 additions & 2 deletions src/app/context/api/DelegationsPointsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ interface DelegationsPointsProviderProps {
publicKeyNoCoord: string;
delegationsAPI: Delegation[];
isWalletConnected: boolean;
address: string;
}

export const DelegationsPointsProvider: React.FC<
DelegationsPointsProviderProps
> = ({ children, publicKeyNoCoord, delegationsAPI, isWalletConnected }) => {
> = ({
children,
publicKeyNoCoord,
delegationsAPI,
isWalletConnected,
address,
}) => {
const [delegationPoints, setDelegationPoints] = useState<Map<string, number>>(
new Map(),
);
Expand All @@ -59,7 +66,7 @@ export const DelegationsPointsProvider: React.FC<
};

const { data, isLoading, error } = useQuery({
queryKey: ["delegationPoints", publicKeyNoCoord, delegationsAPI],
queryKey: ["delegationPoints", address, publicKeyNoCoord],
queryFn: fetchAllPoints,
enabled:
isWalletConnected &&
Expand Down

0 comments on commit 3c02374

Please sign in to comment.