Fix payment display and dashboard refresh functionality
Some checks failed
CI / update (push) Failing after 4s
Some checks failed
CI / update (push) Failing after 4s
- Fix 'paid in full for others' payments showing CHF 0.00 instead of actual amount - Add time-based sorting to payments (date + createdAt) for proper chronological order - Redirect to dashboard after adding payment instead of payments list - Implement complete dashboard refresh after payment deletion via modal - Fix dashboard component reactivity for single debtor view updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,17 @@
|
||||
paymentId = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePaymentDeleted() {
|
||||
// Close the modal
|
||||
showModal = false;
|
||||
paymentId = null;
|
||||
|
||||
// Dispatch a custom event to trigger dashboard refresh
|
||||
if ($page.route.id === '/cospend') {
|
||||
window.dispatchEvent(new CustomEvent('dashboardRefresh'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="layout-container" class:has-modal={showModal}>
|
||||
@@ -36,7 +47,7 @@
|
||||
<div class="modal-content">
|
||||
{#key paymentId}
|
||||
<div in:fly={{x: 50, duration: 300, easing: quintOut}} out:fly={{x: -50, duration: 300, easing: quintOut}}>
|
||||
<PaymentModal {paymentId} on:close={() => showModal = false} />
|
||||
<PaymentModal {paymentId} on:close={() => showModal = false} on:paymentDeleted={handlePaymentDeleted} />
|
||||
</div>
|
||||
{/key}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user