From 0522ca8d9f72e41733b8a7b3d56692fa24c4fc1d Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Thu, 17 Apr 2025 16:18:53 +0200 Subject: [PATCH] Fix crypto payment warning --- svelte/src/layout/CreditDeposit.svelte | 18 ++++++++++-------- svelte/src/user_home/DepositCredit.svelte | 8 ++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/svelte/src/layout/CreditDeposit.svelte b/svelte/src/layout/CreditDeposit.svelte index 571271a..7772a4a 100644 --- a/svelte/src/layout/CreditDeposit.svelte +++ b/svelte/src/layout/CreditDeposit.svelte @@ -209,14 +209,16 @@ const format_country = (c: typeof countries.all[0]) => { {:else} -

- When paying with cryptocurrencies it is important that you pay the - exact amount stated on the order. If you pay too little, the - order fails. If you pay too much then the remaining credit will not - be added to your account. Pay close attention when sending a payment - from an online exchange, sometimes they will subtract the fees from - the amount sent which will cause the payment to fail. -

+ {#if provider.crypto === true} +

+ When paying with cryptocurrencies it is important that you pay the + exact amount stated on the order. If you pay too little, the + order fails. If you pay too much then the remaining credit will not + be added to your account. Pay close attention when sending a payment + from an online exchange, sometimes they will subtract the fees from + the amount sent which will cause the payment to fail. +

+ {/if}
Please choose an amount
diff --git a/svelte/src/user_home/DepositCredit.svelte b/svelte/src/user_home/DepositCredit.svelte index 602e6fd..469855c 100644 --- a/svelte/src/user_home/DepositCredit.svelte +++ b/svelte/src/user_home/DepositCredit.svelte @@ -40,7 +40,7 @@ const checkout = async (network = "", amount = 0, country = "") => { } let invoices = [] -let unpaid_invoice = false +let unpaid_invoice = 0 const load_invoices = async () => { loading = true try { @@ -50,12 +50,12 @@ const load_invoices = async () => { } let invoices_tmp = await resp.json() - unpaid_invoice = false + unpaid_invoice = 0 invoices_tmp.forEach(row => { row.time = new Date(row.time) if (row.status === "open") { - unpaid_invoice = true + unpaid_invoice++ } }) invoices_tmp.sort((a, b) => { @@ -88,7 +88,7 @@ onMount(() => { amount={window.user.balance_micro_eur}/>

- {#if unpaid_invoice} + {#if unpaid_invoice > 1}

You still have an unpaid invoice open. Please pay that one