Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Fix for investment amount reset when you go back (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadV91 authored Jan 21, 2022
1 parent 0132fe7 commit edac11d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/custom/pages/Claim/InvestmentFlow/InvestOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ export default function InvestOption({ approveData, claim, optionIndex }: Invest
}
}, [balance, isSelfClaiming, maxCost, setMaxAmount])

// this will set input and percentage value if you go back from the review page
useEffect(() => {
const { investmentCost } = calculateInvestmentAmounts(claim, investedAmount)

if (investmentCost) {
onInputChange(investmentCost?.toExact())
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
<InvestTokenGroup>
<div>
Expand Down

0 comments on commit edac11d

Please sign in to comment.