fix(types): resolve pre-existing svelte-check errors
stale-containers page referenced container.id but StaleContainer wraps an inner instance object — switch to container.instance.id at the three call sites. env editor derived projectId from $page.params.id (string | undefined); coalesce to empty string so call sites that pass it to API helpers don't trip the strictNullChecks gate. Pre-existing errors flagged by `svelte-check`; not introduced by recent feature work but blocking the green check.
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
cleaningIds = new Set([...cleaningIds, id]);
|
cleaningIds = new Set([...cleaningIds, id]);
|
||||||
try {
|
try {
|
||||||
await api.cleanupStaleContainer(id);
|
await api.cleanupStaleContainer(id);
|
||||||
containers = containers.filter((c) => c.id !== id);
|
containers = containers.filter((c) => c.instance.id !== id);
|
||||||
toasts.success($t('stale.cleanedUp'));
|
toasts.success($t('stale.cleanedUp'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toasts.error(e instanceof Error ? e.message : $t('stale.cleanupFailed'));
|
toasts.error(e instanceof Error ? e.message : $t('stale.cleanupFailed'));
|
||||||
@@ -124,10 +124,10 @@
|
|||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
{#each containers as container (container.id)}
|
{#each containers as container (container.instance.id)}
|
||||||
<StaleContainerCard
|
<StaleContainerCard
|
||||||
{container}
|
{container}
|
||||||
cleaning={cleaningIds.has(container.id)}
|
cleaning={cleaningIds.has(container.instance.id)}
|
||||||
oncleanup={requestCleanup}
|
oncleanup={requestCleanup}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
+4
-1
@@ -40,7 +40,10 @@
|
|||||||
let editProjectValue = $state('');
|
let editProjectValue = $state('');
|
||||||
let projectEnvDeleteTarget = $state<string | null>(null);
|
let projectEnvDeleteTarget = $state<string | null>(null);
|
||||||
|
|
||||||
const projectId = $derived($page.params.id);
|
// $page.params.id is typed string | undefined because SvelteKit can't
|
||||||
|
// statically prove the [id] segment is present, but inside this route file
|
||||||
|
// it always is — assert non-null so call sites don't need their own guards.
|
||||||
|
const projectId = $derived($page.params.id ?? '');
|
||||||
|
|
||||||
async function handleAddProjectEnv() {
|
async function handleAddProjectEnv() {
|
||||||
if (!newProjectKey.trim()) return;
|
if (!newProjectKey.trim()) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user