From 7514a228d5dcc0b9452ce391bd9b06c4c99d5b61 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Thu, 25 Jun 2026 14:35:17 +0100 Subject: [PATCH] =?UTF-8?q?style:=20fix=20prefer-writable-derived=20?= =?UTF-8?q?=E2=80=94=20use=20$derived.writable=20instead=20of=20$state+$ef?= =?UTF-8?q?fect=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lib/components/payments/UserPaymentModal.svelte | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/src/lib/components/payments/UserPaymentModal.svelte b/frontend/src/lib/components/payments/UserPaymentModal.svelte index 06235b9..c47cc28 100644 --- a/frontend/src/lib/components/payments/UserPaymentModal.svelte +++ b/frontend/src/lib/components/payments/UserPaymentModal.svelte @@ -217,10 +217,7 @@ // state. The backend will split the charge into deposit + non-deposit records // when appropriate, so this choice mainly controls the button label and amount. const defaultType = $derived(defaultPaymentType ?? (depositOutstanding ? 'deposit' : 'full')); - let paymentType = $state<'full' | 'partial' | 'deposit'>('full'); - $effect(() => { - paymentType = defaultType as 'full' | 'partial' | 'deposit'; - }); + let paymentType = $derived.writable(defaultType as 'full' | 'partial' | 'deposit'); let pollingInterval: ReturnType | null = null;