File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 10
10
export let files: File [];
11
11
export let pdfUpload: PdfUpload | undefined = undefined ;
12
12
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
+
16
17
let fileInput: HTMLInputElement ;
17
18
let interval: ReturnType <typeof setInterval >;
18
19
Original file line number Diff line number Diff line change 14
14
</script >
15
15
16
16
<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"
18
18
class:animate-pulse ={uploading }
19
19
class:pointer-events-none ={uploading }
20
20
title ={pdfUpload .name }
Original file line number Diff line number Diff line change 182
182
<UploadedPdfStatus on:deletepdf {pdfUpload } />
183
183
{/if }
184
184
{#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
+ />
186
192
{/if }
187
193
</div >
188
194
</div >
Original file line number Diff line number Diff line change 295
295
}
296
296
297
297
async function deletePdf() {
298
+ pdfUpload = undefined ;
299
+
298
300
const res = await fetch (` ${base }/conversation/${$page .params .id }/upload-pdf ` , {
299
301
method: " DELETE" ,
300
302
});
303
305
error .set (" Error while deleting PDF, try again." );
304
306
console .error (" Error while deleting PDF: " + (await res .text ()));
305
307
}
306
-
307
- pdfUpload = undefined ;
308
308
}
309
309
310
310
onMount (async () => {
You can’t perform that action at this time.
0 commit comments