Skip to content

Commit

Permalink
Fixing import boost (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWoodard authored Sep 4, 2023
1 parent f9ce975 commit 575dc2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions earn/src/components/boost/ImportBoostWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ export default function ImportBoostWidget(props: ImportBoostWidgetProps) {
if (!apr0 || !apr1) {
return { dailyInterest0: null, dailyInterest1: null };
}
const dailyInterest0 = (apr0 / 365) * (cardInfo.borrower?.liabilities.amount0 || 0);
const dailyInterest1 = (apr1 / 365) * (cardInfo.borrower?.liabilities.amount1 || 0);
const dailyInterest0 = (apr0 / 365) * (cardInfo.amount0() * (boostFactor - 1));
const dailyInterest1 = (apr1 / 365) * (cardInfo.amount1() * (boostFactor - 1));
return { dailyInterest0, dailyInterest1 };
}, [apr0, apr1, cardInfo.borrower?.liabilities.amount0, cardInfo.borrower?.liabilities.amount1]);
}, [apr0, apr1, boostFactor, cardInfo]);

const nftTokenId = ethers.BigNumber.from(cardInfo?.nftTokenId || 0);
const initializationData = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions earn/src/pages/boost/ImportBoostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function ImportBoostPage() {
);
}, [cardInfo, boostFactor]);

const isLoading = !updatedCardInfo || !tokenId;
const isLoading = !cardInfo || !updatedCardInfo || !tokenId;
return (
<AppPage>
<div className='mb-4'>
Expand All @@ -180,7 +180,7 @@ export default function ImportBoostPage() {
<BoostCard info={updatedCardInfo} uniqueId={tokenId} isDisplayOnly={true} />
<div className='flex-grow'>
<ImportBoostWidget
cardInfo={updatedCardInfo}
cardInfo={cardInfo}
boostFactor={boostFactor}
setBoostFactor={setBoostFactor}
setPendingTxn={setPendingTxn}
Expand Down

0 comments on commit 575dc2c

Please sign in to comment.