Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoirot committed Jan 9, 2024
2 parents fc4f2e5 + eea13bf commit 1b52ab3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/components/ErrorCard.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
export let error: string
let card: HTMLDivElement
let x: number = 0
let y: number = 0
function handleMouseMove(e: MouseEvent) {
if (!card) return
Expand Down
4 changes: 2 additions & 2 deletions src/components/GenerationList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@

<section class="overflow-y-auto max-h-full px-2 lg:pr-4 pt-6">
{#if Object.keys($generations).length > 0}
{#each Object.entries($generations).toSorted(sortTimeBuckets) as [category, items], i}
{#each Object.entries($generations).toSorted(sortTimeBuckets) as [category, items]}
<div class="first-of-type:mt-0 mt-12">
<h2 class="pl-2 lg:pl-4 text-xl">{category}</h2>
<ul class="m-0 p-0">
{#each items as item, j}
{#each items as item}
<li id={item.id} class="first-of-type:mt-2 my-4">
<GenerationListItem data={item} />
</li>
Expand Down
3 changes: 1 addition & 2 deletions src/components/GenerationListItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import Checkmark from 'components/Icons/Checkmark.svelte'
import Close from 'components/Icons/Close.svelte'
import Spinner from 'components/Icons/Spinner.svelte'
import type { Models } from '@kittycad/lib'
import { fetchedGenerations, localGenerations, type GenerationWithSource } from '$lib/stores'
export let data: GenerationWithSource
Expand Down Expand Up @@ -60,7 +59,7 @@
<span class="text">{data.prompt}</span>
{#if data.status === 'completed'}
<Checkmark class="w-5 h-5" />
{:else if data.status === 'failed'}
{:else if data.status === 'failed' || error}
<Close class="w-5 h-5" />
{:else}
<Spinner class="w-5 h-5 animate-spin" />
Expand Down
3 changes: 1 addition & 2 deletions src/components/PromptForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
export let token: string
let inputValue = $page.url.searchParams.get('prompt') ?? ''
let form = null as HTMLFormElement | null
let button = null as HTMLButtonElement | null
let error: string | null = null
let isSubmitting = false
Expand Down Expand Up @@ -65,7 +64,7 @@
}
</script>

<form on:submit={submitForm} class="flex border items-stretch text-lg" bind:this={form}>
<form on:submit={submitForm} class="flex border items-stretch text-lg">
<label class="flex-1 grid place-items-center">
<span class="sr-only">Enter a text-to-CAD prompt:</span>
<textarea
Expand Down
8 changes: 6 additions & 2 deletions src/routes/(sidebarLayout)/view/[modelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
export let data: Models['TextToCad_type']
let poller: ReturnType<typeof setInterval> | undefined
let error: { message: string; status: number }
let pollingError: { message: string; status: number }
const setupPoller = (id: string) => {
if (poller) {
Expand All @@ -30,7 +30,7 @@
})
const newResponse: LoadResponse = await res.json().catch((err) => {
console.error(err)
error = { message: 'Failed to poll for generation status', status: res.status }
pollingError = { message: 'Failed to poll for generation status', status: res.status }
})
data = newResponse.body ? newResponse.body : data
Expand Down Expand Up @@ -83,6 +83,10 @@
<div class="grid flex-grow place-content-center p-4">
<ErrorCard error={data.error} />
</div>
{:else if pollingError}
<div class="grid flex-grow place-content-center p-4">
<ErrorCard error={pollingError.status + ' ' + pollingError.message} />
</div>
{:else}
<div class="flex-grow flex items-center justify-center">
<Spinner class="w-10 h-10 animate-spin" />
Expand Down

0 comments on commit 1b52ab3

Please sign in to comment.