Skip to content

Commit

Permalink
Fix insufficient amount on load
Browse files Browse the repository at this point in the history
  • Loading branch information
victorkirov committed Feb 13, 2024
1 parent 6702d63 commit 0d6d8b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/screens/sendBtc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SendBtcScreen() {
}, [btcFeeRate, feeRatesLoading]);

const generateTransactionAndSummary = async (feeRateOverride?: number) => {
const amountBigInt = BigInt(amountSats);
const amountBigInt = Number.isNaN(Number(amountSats)) ? 0n : BigInt(amountSats);
const transactionDetails =
sendMax && currentStep !== Step.Confirm
? await generateSendMaxTransaction(
Expand All @@ -70,7 +70,7 @@ function SendBtcScreen() {
};

useEffect(() => {
if (!recipientAddress || !(amountSats || sendMax) || !feeRate) {
if (!recipientAddress || !feeRate) {
setTransaction(undefined);
setSummary(undefined);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/sendBtc/stepDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function StepDisplay({
getFeeForFeeRate={getFeeForFeeRate}
dustFiltered={summary?.dustFiltered ?? false}
onNext={() => setCurrentStep(getNextStep(Step.SelectAmount, amountEditable))}
hasSufficientFunds={!amountSats || !!summary || isLoading}
hasSufficientFunds={!!summary || isLoading}
isLoading={isLoading}
/>
</Container>
Expand Down

0 comments on commit 0d6d8b2

Please sign in to comment.