@huma-finance/widgets 0.0.51-beta.225 → 0.0.51-beta.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.cjs
CHANGED
|
@@ -3475,8 +3475,8 @@ function ChooseAmount$5(_ref) {
|
|
|
3475
3475
|
}));
|
|
3476
3476
|
}, [dispatch]);
|
|
3477
3477
|
var handleAction = React.useCallback(function () {
|
|
3478
|
-
var payAmount = shared.upScale(currentAmount, decimals);
|
|
3479
|
-
var step =
|
|
3478
|
+
var payAmount = shared.upScale(shared.toBigNumber(currentAmount), decimals);
|
|
3479
|
+
var step = payAmount.gt(allowance) ? WIDGET_STEP.ApproveAllowance : WIDGET_STEP.Transfer;
|
|
3480
3480
|
dispatch(setStep(step));
|
|
3481
3481
|
}, [allowance, currentAmount, decimals, dispatch]);
|
|
3482
3482
|
return jsxRuntime.jsx(ChooseAmountModal, {
|
|
@@ -3513,7 +3513,7 @@ function Transfer$5(_ref) {
|
|
|
3513
3513
|
var _useAppSelector = useAppSelector(selectWidgetState),
|
|
3514
3514
|
paymentAmount = _useAppSelector.paymentAmount;
|
|
3515
3515
|
var decimals = poolInfo.poolUnderlyingToken.decimals;
|
|
3516
|
-
var paymentBigNumber = shared.
|
|
3516
|
+
var paymentBigNumber = shared.upScale(shared.toBigNumber(paymentAmount), decimals);
|
|
3517
3517
|
var handleSuccess = React.useCallback(function () {
|
|
3518
3518
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
3519
3519
|
}, [dispatch]);
|