Skip to content

Commit

Permalink
fix: page crash when Lend contract cant be queried
Browse files Browse the repository at this point in the history
  • Loading branch information
soulBit committed Apr 12, 2023
1 parent a801cc7 commit 70e6ccf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/hooks/lending/useGetLendingHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LoanTokenGraphItem } from 'app/components/LoanTokenGraphs/types';

export function useGetLendingHistory(pool: LendingPool) {
const [data, setData] = useState<LoanTokenGraphItem[]>([]);
const poolAddress = getLendingContract(pool.getAsset()).address;
const poolAddress = getLendingContract(pool.getAsset())?.address;

useEffect(() => {
if (currentChainId !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/lending/useLending_recentRewardSOV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function useLending_recentRewardSOV(asset: Asset) {
const {
value: poolID,
loading: poolIDLoading,
} = useLiquidityMining_getPoolId(getLendingContract(asset).address);
} = useLiquidityMining_getPoolId(getLendingContract(asset)?.address);

useEffect(() => {
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const UserLendingInfo: React.FC<IUserLendingInfoProps> = ({
value: rewards,
loading: rewardsLoading,
} = useLiquidityMining_getUserAccumulatedReward(
getLendingContract(asset).address,
getLendingContract(asset)?.address,
);

const recentRewardSOV = useLending_recentRewardSOV(asset);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/blockchain/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const getCall = (id: string) => {
};

export const idHash = (args: any[]) => {
const params = args.map(item => item.toString().toLowerCase());
const params = args.map(item => item?.toString().toLowerCase());
const json = JSON.stringify(params);
return hashMessage(json);
};

0 comments on commit 70e6ccf

Please sign in to comment.