Skip to content

Commit 6d0f57a

Browse files
authored
Update InputPagar.svelte
1 parent 4e3d354 commit 6d0f57a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/lib/InputPagar.svelte

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232
async function submitForm() {
3333
// Aquí puedes agregar la lógica para manejar el envío del formulario
3434
console.log(`Amount: ${amount}, Recipient: ${recipient}`);
35-
35+
cargando=true
3636
const seEnvio = await createPayment(amount, stellarAccount, recipient);
37-
37+
cargando=false
3838
const paymentDone: PaymentDone = {
3939
amount,
4040
destination: recipient,
4141
};
4242
dispatcher('paymentDone', paymentDone);
4343
}
44+
let cargando=false
4445
</script>
4546

4647
<div
@@ -88,9 +89,16 @@
8889
recipient = '';
8990
}}>Cancelar</button
9091
>
91-
<button
92+
<button disabled={cargando}
9293
class="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700"
93-
on:click={submitForm}>Enviar</button
94+
on:click={submitForm}>
95+
{#if cargando}
96+
Enviando
97+
{:else}
98+
Enviar
99+
{/if}
100+
101+
</button
94102
>
95103
</div>
96104
</div>

0 commit comments

Comments
 (0)