chore(LINT-0001) fix lint errors
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
import type { Repository } from '$lib/types';
|
||||
import RepositoryCard from '$lib/components/RepositoryCard.svelte';
|
||||
import AddRepositoryModal from '$lib/components/AddRepositoryModal.svelte';
|
||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||
import IndexingProgress from '$lib/components/IndexingProgress.svelte';
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
type Repository = NonNullable<PageData['repositories']>[number];
|
||||
|
||||
// Initialized empty; $effect syncs from data prop on every navigation/reload.
|
||||
let repositories = $state<Repository[]>([]);
|
||||
$effect(() => {
|
||||
repositories = data.repositories ?? [];
|
||||
});
|
||||
// Syncs from data prop on navigation while still allowing temporary local reassignment.
|
||||
let repositories: Repository[] = $derived(data.repositories ?? []);
|
||||
let showAddModal = $state(false);
|
||||
let confirmDeleteId = $state<string | null>(null);
|
||||
let activeJobIds = $state<Record<string, string>>({});
|
||||
@@ -25,7 +22,7 @@
|
||||
async function refreshRepositories() {
|
||||
try {
|
||||
const res = await fetch('/api/v1/libs');
|
||||
const fetched = await res.json();
|
||||
const fetched = (await res.json()) as { libraries?: Repository[] };
|
||||
repositories = fetched.libraries ?? [];
|
||||
} catch {
|
||||
// keep existing list on network error
|
||||
|
||||
Reference in New Issue
Block a user