style: fix prefer-svelte-reactivity — replace with Svelte reactive equivalents

This commit is contained in:
2026-06-25 14:40:22 +01:00
parent d5e93b3be2
commit 334b911e16
11 changed files with 35 additions and 29 deletions
@@ -1,7 +1,7 @@
<script lang="ts">
import { authStore } from '$lib/stores/auth.svelte';
import { toast } from 'svelte-sonner';
import { SvelteDate } from 'svelte/reactivity';
import { SvelteDate, SvelteSet, SvelteURLSearchParams } from 'svelte/reactivity';
import { CalendarDate, getLocalTimeZone, type DateValue } from '@internationalized/date';
import { isValidUKPhone, toE164UK } from '$lib/utils/phone';
import { formatUserName } from '$lib/utils/nameDisplay';
@@ -235,7 +235,7 @@
// =============== Cache ===============
let workingHoursCache: Record<string, Record<string, DayHours>> = {};
let availableHoursCache: Record<string, Record<string, DayAvailability>> = {};
let loadingMonthKeys: Set<string> = new Set();
let loadingMonthKeys: Set<string> = new SvelteSet();
// =============== Derived Helpers ===============
function getTotalDuration() {
@@ -456,7 +456,7 @@
bookingCreateInitialLoadDone = false;
userNavigatedCalendar = false;
bookingCreateAutoSelectDone = false;
loadingMonthKeys = new Set();
loadingMonthKeys = new SvelteSet();
outOfHours = false;
normalWorkingHours = null;
// Clear reservation state
@@ -602,7 +602,7 @@
// Prevent re-entrant calls for the same month
if (loadingMonthKeys.has(monthKey)) return;
loadingMonthKeys = new Set(loadingMonthKeys).add(monthKey);
loadingMonthKeys = new SvelteSet(loadingMonthKeys).add(monthKey);
hoursMonthGeneration++;
const gen = hoursMonthGeneration;
@@ -657,7 +657,7 @@
} finally {
_loadingWorkingHours = false;
loadingAvailableHours = false;
loadingMonthKeys = new Set([...loadingMonthKeys].filter((k) => k !== monthKey));
loadingMonthKeys = new SvelteSet([...loadingMonthKeys].filter((k) => k !== monthKey));
}
}
@@ -811,7 +811,7 @@
async function fetchCustomServices() {
loadingCustomServices = true;
try {
const params = new URLSearchParams();
const params = new SvelteURLSearchParams();
if (customSearchQuery.trim()) {
params.set('q', customSearchQuery.trim());
} else {