Skip to content

Commit 61d3bc2

Browse files
committed
format
1 parent ccbdf27 commit 61d3bc2

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/lib/components/UploadBtn.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
export let files: File[];
1111
export let pdfUpload: PdfUpload | undefined = undefined;
1212
13-
const accept = (multimodal && pdfChat) ? "image/*,.pdf" : multimodal ? "image/*" : ".pdf";
14-
const label = (multimodal && pdfChat) ? "Upload image or PDF" : multimodal ? "Upload image" : "Upload PDF";
15-
13+
const accept = multimodal && pdfChat ? "image/*,.pdf" : multimodal ? "image/*" : ".pdf";
14+
const label =
15+
multimodal && pdfChat ? "Upload image or PDF" : multimodal ? "Upload image" : "Upload PDF";
16+
1617
let fileInput: HTMLInputElement;
1718
let interval: ReturnType<typeof setInterval>;
1819

src/lib/components/UploadedPdfStatus.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</script>
1515

1616
<div
17-
class="max-w-48 group flex items-center gap-x-1"
17+
class="group flex max-w-48 items-center gap-x-1"
1818
class:animate-pulse={uploading}
1919
class:pointer-events-none={uploading}
2020
title={pdfUpload.name}

src/lib/components/chat/ChatWindow.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,13 @@
182182
<UploadedPdfStatus on:deletepdf {pdfUpload} />
183183
{/if}
184184
{#if currentModel.multimodal || $page.data.enablePdfChat}
185-
<UploadBtn bind:files on:uploadpdf multimodal={currentModel.multimodal} pdfChat={$page.data.enablePdfChat} {pdfUpload} />
185+
<UploadBtn
186+
bind:files
187+
on:uploadpdf
188+
multimodal={currentModel.multimodal}
189+
pdfChat={$page.data.enablePdfChat}
190+
{pdfUpload}
191+
/>
186192
{/if}
187193
</div>
188194
</div>

src/routes/conversation/[id]/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@
295295
}
296296
297297
async function deletePdf() {
298+
pdfUpload = undefined;
299+
298300
const res = await fetch(`${base}/conversation/${$page.params.id}/upload-pdf`, {
299301
method: "DELETE",
300302
});
@@ -303,8 +305,6 @@
303305
error.set("Error while deleting PDF, try again.");
304306
console.error("Error while deleting PDF: " + (await res.text()));
305307
}
306-
307-
pdfUpload = undefined;
308308
}
309309
310310
onMount(async () => {

0 commit comments

Comments
 (0)