style: fix prefer-writable-derived — use $derived.writable instead of $state+$effect sync

This commit is contained in:
2026-06-25 14:35:17 +01:00
parent 8a339b7810
commit 7514a228d5
@@ -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<typeof setInterval> | null = null;