Skip to content

Commit ac29606

Browse files
authored
fix: switch network button disabled (#289)
1 parent ec6ca36 commit ac29606

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/invoice-dashboard/src/lib/dashboard/invoice-view.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@
396396
async function approve() {
397397
try {
398398
loading = true;
399+
isSigningTransaction = true;
399400
400401
const approvers: { [key: string]: () => Promise<void> } = {
401402
[Types.Extension.PAYMENT_NETWORK_ID.ERC20_FEE_PROXY_CONTRACT]:
@@ -430,6 +431,7 @@
430431
console.error("Something went wrong while approving ERC20: ", err);
431432
} finally {
432433
loading = false;
434+
isSigningTransaction = false;
433435
}
434436
}
435437
@@ -847,7 +849,7 @@
847849
{/if}
848850
<div class="invoice-view-actions">
849851
{#if !isPayee && !unsupportedNetwork && !isPaid && !isRequestPayed && !isSigningTransaction && !unknownCurrency}
850-
{#if !hasEnoughBalance}
852+
{#if !hasEnoughBalance && correctChain}
851853
<div class="balance-warning">
852854
Insufficient funds: {Number(userBalance).toFixed(4)}
853855
{paymentCurrencies[0]?.symbol || "-"}
@@ -863,7 +865,9 @@
863865
: "Pay Now"}
864866
padding="px-[12px] py-[6px]"
865867
onClick={handlePayment}
866-
disabled={!hasEnoughBalance}
868+
disabled={correctChain
869+
? !hasEnoughBalance || isSigningTransaction
870+
: false}
867871
/>
868872
{/if}
869873
</div>

0 commit comments

Comments
 (0)