Fix crypto payment warning

This commit is contained in:
2025-04-17 16:18:53 +02:00
parent 9cc0fe1f38
commit 0522ca8d9f
2 changed files with 14 additions and 12 deletions

View File

@@ -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}/>
</p>
{#if unpaid_invoice}
{#if unpaid_invoice > 1}
<div class="highlight_yellow">
<p>
You still have an unpaid invoice open. Please pay that one