From d9a47f882c1c6bcf98ef85d50d70c010d54b326e Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 9 May 2023 16:29:25 +0200 Subject: [PATCH] Changed the in table replacement method --- src/components/donations/DonationsOverview.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/donations/DonationsOverview.svelte b/src/components/donations/DonationsOverview.svelte index a9148703..7baa4cc5 100644 --- a/src/components/donations/DonationsOverview.svelte +++ b/src/components/donations/DonationsOverview.svelte @@ -195,9 +195,12 @@ payment_modal_open={active_edits.length > 0} paid_amount_input={(active_edits[0]?.paidAmount || 0) / 100} on:created={(event) => { - current_donations[ - current_donations.findIndex((d) => d.id === event.detail.donation.id) - ].paidAmount = event.detail.donation.paidAmount; + current_donations = current_donations.map((d)=>{ + if(d.id === event.detail.donation.id){ + d.paidAmount = event.detail.donation.paidAmount; + } + return d; + }) options.update((options) => ({ ...options, data: current_donations,