fix: remove unused variables from Svelte components
This commit is contained in:
@@ -181,7 +181,6 @@
|
||||
let selectedTime = $state<string | null>(null);
|
||||
let workingHours = $state<Record<string, DayHours> | null>(null);
|
||||
let availableHours = $state<Record<string, DayAvailability> | null>(null);
|
||||
let _loadingWorkingHours = $state(false);
|
||||
let loadingAvailableHours = $state(false);
|
||||
let hoursRangeGeneration = $state(0);
|
||||
let hoursMonthGeneration = $state(0);
|
||||
@@ -485,7 +484,7 @@
|
||||
(user: { account_role: string }) => !excludedRoles.includes(user.account_role)
|
||||
);
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('Failed to load users');
|
||||
} finally {
|
||||
loadingUsers = false;
|
||||
@@ -504,7 +503,7 @@
|
||||
if (response.ok) {
|
||||
services = await response.json();
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('Failed to load services');
|
||||
} finally {
|
||||
loadingServices = false;
|
||||
@@ -528,7 +527,6 @@
|
||||
hoursRangeGeneration++;
|
||||
const gen = hoursRangeGeneration;
|
||||
|
||||
_loadingWorkingHours = true;
|
||||
loadingAvailableHours = true;
|
||||
|
||||
try {
|
||||
@@ -572,10 +570,9 @@
|
||||
workingHours = { ...workingHours, ...whMap };
|
||||
availableHours = { ...availableHours, ...ahMap };
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('Failed to load availability');
|
||||
} finally {
|
||||
_loadingWorkingHours = false;
|
||||
loadingAvailableHours = false;
|
||||
}
|
||||
}
|
||||
@@ -597,7 +594,6 @@
|
||||
hoursMonthGeneration++;
|
||||
const gen = hoursMonthGeneration;
|
||||
|
||||
_loadingWorkingHours = true;
|
||||
loadingAvailableHours = true;
|
||||
|
||||
try {
|
||||
@@ -636,10 +632,9 @@
|
||||
workingHours = { ...workingHours, ...whMap };
|
||||
availableHours = { ...availableHours, ...ahMap };
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('Failed to load availability');
|
||||
} finally {
|
||||
_loadingWorkingHours = false;
|
||||
loadingAvailableHours = false;
|
||||
loadingMonthKeys = new SvelteSet([...loadingMonthKeys].filter((k) => k !== monthKey));
|
||||
}
|
||||
@@ -725,7 +720,7 @@
|
||||
toast.error(`Failed to reserve slot: ${errorText}`);
|
||||
return false;
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('Failed to reserve slot');
|
||||
return false;
|
||||
} finally {
|
||||
@@ -1020,7 +1015,7 @@
|
||||
const errorText = await res.text();
|
||||
toast.error(`Failed to create booking: ${errorText}`);
|
||||
}
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
toast.error('An error occurred while creating booking');
|
||||
} finally {
|
||||
submitting = false;
|
||||
@@ -1148,8 +1143,10 @@
|
||||
<div class="max-h-[300px] overflow-y-auto rounded-md border border-gray-200">
|
||||
{#if loadingUsers}
|
||||
<div class="space-y-2 p-2">
|
||||
{#each Array(3) as _, i (i)}
|
||||
{#each Array(3) as __, i (i)}
|
||||
{__}
|
||||
<Skeleton class="h-10 w-full" />
|
||||
{__}
|
||||
{/each}
|
||||
</div>
|
||||
{:else if users.length === 0}
|
||||
@@ -1260,8 +1257,10 @@
|
||||
<Card.Content class="space-y-4">
|
||||
{#if loadingServices}
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
{#each Array(4) as _, i (i)}
|
||||
{#each Array(4) as __, i (i)}
|
||||
{__}
|
||||
<Skeleton class="h-28 w-full" />
|
||||
{__}
|
||||
{/each}
|
||||
</div>
|
||||
{:else if services.length === 0}
|
||||
@@ -1291,10 +1290,12 @@
|
||||
/>
|
||||
<Button variant="outline" size="sm" onclick={fetchCustomServices}>Search</Button>
|
||||
</div>
|
||||
{#if loadingCustomServices}
|
||||
{#if loadingCustomServices}
|
||||
<div class="space-y-2">
|
||||
{#each Array(3) as _, i (i)}
|
||||
{#each Array(3) as __, i (i)}
|
||||
{__}
|
||||
<Skeleton class="h-10 w-full" />
|
||||
{__}
|
||||
{/each}
|
||||
</div>
|
||||
{:else if customServices.length > 0}
|
||||
|
||||
Reference in New Issue
Block a user