diff --git a/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte b/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte index d15278c589..902e5cdc7a 100644 --- a/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte +++ b/tools/ui/src/lib/components/app/models/discover/DialogModelDownload.svelte @@ -31,13 +31,13 @@ /** Error message from a failed start attempt, shown above the footer. */ error?: string | null; /** Fire the download (POST /models). */ - onDownload: () => void; + onDownload?: () => void; /** Cancel the in-flight download (DELETE /models). */ onCancelDownload?: () => void; /** Delete the model from the server cache; offered once finished. */ onDelete?: () => void; /** Dialog was dismissed or the download completed. */ - onClose: () => void; + onClose?: () => void; } let { @@ -102,7 +102,7 @@ return; } - if (!inFlight) onClose(); + if (!inFlight) onClose?.(); } function handleKeydown(event: KeyboardEvent) { @@ -118,7 +118,7 @@ started = true; sawProgress = false; - onDownload(); + onDownload?.(); } async function cancel() { @@ -137,7 +137,7 @@ showDeleteConfirm = false; onDelete?.(); - onClose(); + onClose?.(); } // Latch progress: 'in-flight ending' only means finished once the feed has @@ -150,7 +150,7 @@ $effect(() => { if (phase !== 'finished') return; - const timer = setTimeout(() => onClose(), 600); + const timer = setTimeout(() => onClose?.(), 600); return () => clearTimeout(timer); }); @@ -280,7 +280,7 @@ {/if} {:else} - onClose()}> + onClose?.()}> {#if phase === 'finished'}Close{:else}Cancel{/if} {/if} diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte index b4b5db1c8a..1a6205cfbd 100644 --- a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte +++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetails.svelte @@ -106,12 +106,7 @@ {modelId} /> - + diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte index 5b9da11818..d5678edf00 100644 --- a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte +++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverDetailsDownloadOptions.svelte @@ -1,14 +1,14 @@