style: fix prefer-writable-derived — use $derived.writable instead of $state+$effect sync
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user