Skip to content

Commit fc77098

Browse files
committed
fix: check correct reserve for flashloan enabled on debt and repay
1 parent dd88b41 commit fc77098

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/transactions/Swap/errors/shared/FlashLoanDisabledBlockingGuard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export const hasFlashLoanDisabled = (state: SwapState): boolean => {
1010
return false;
1111
}
1212

13-
if (
14-
state.useFlashloan === true &&
15-
state.sourceReserve?.reserve &&
16-
!state.sourceReserve.reserve.flashLoanEnabled
17-
) {
13+
const reserve = !state.isInvertedSwap
14+
? state.sourceReserve?.reserve
15+
: state.destinationReserve?.reserve;
16+
17+
if (state.useFlashloan === true && reserve && !reserve.flashLoanEnabled) {
1818
return true;
1919
}
2020

0 commit comments

Comments
 (0)