Skip to content

Commit

Permalink
Merge pull request #25 from UniqueClone/main
Browse files Browse the repository at this point in the history
Ignore max loan if == 0
  • Loading branch information
UniqueClone authored Jul 15, 2024
2 parents 6e65295 + 73ac9a4 commit 8c98964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/MortgageDetails/MortgageDetails.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const getMonthlyPayment = (
};

export const setLoanAmountToMax = (houseValue: number, maxLoanAmount: number, setLoanAmount: (newValue: number) => void) => {
if (houseValue * 0.9 > maxLoanAmount) {
if (houseValue * 0.9 > maxLoanAmount && maxLoanAmount > 0) {
setLoanAmount(maxLoanAmount);
} else {
setLoanAmount(houseValue * 0.9);
Expand Down

0 comments on commit 8c98964

Please sign in to comment.