Skip to content

Commit

Permalink
feat: show onchain balance in increase spending capacity screen (#316)
Browse files Browse the repository at this point in the history
* chore: show onchain balance in increase spending capacity screen

* chore: change wording

* fix: undo change to show advanced default state

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
  • Loading branch information
im-adithya and rolznz authored Jul 25, 2024
1 parent 6b1aa0e commit 60d1467
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/screens/channels/IncreaseOutgoingCapacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,11 @@ function NewChannelInternal({ network }: { network: Network }) {
}
}

if (!channelPeerSuggestions) {
if (!channelPeerSuggestions || !balances) {
return <Loading />;
}

const openImmediately =
balances &&
order.amount &&
order.paymentMethod === "onchain" &&
+order.amount < balances.onchain.spendable;
Expand Down Expand Up @@ -241,6 +240,10 @@ function NewChannelInternal({ network }: { network: Network }) {
setAmount(e.target.value.trim());
}}
/>
<div className="text-muted-foreground text-sm">
Current savings balance:{" "}
{new Intl.NumberFormat().format(balances.onchain.spendable)} sats
</div>
<div className="grid grid-cols-3 gap-1.5 text-muted-foreground text-xs">
{presetAmounts.map((amount) => (
<div
Expand Down

0 comments on commit 60d1467

Please sign in to comment.