This commit is contained in:
Timothy Jaeryang Baek 2025-12-11 00:11:12 -05:00
parent 4b4241273d
commit 4d9a51ba33
3 changed files with 4 additions and 6 deletions

View file

@ -135,7 +135,7 @@ class KnowledgeResponse(KnowledgeModel):
class KnowledgeUserResponse(KnowledgeUserModel): class KnowledgeUserResponse(KnowledgeUserModel):
files: Optional[list[FileMetadataResponse | dict]] = None pass
class KnowledgeForm(BaseModel): class KnowledgeForm(BaseModel):

View file

@ -39,8 +39,6 @@
}; };
</script> </script>
{sourceIds}
{#if sourceIds} {#if sourceIds}
{#if (token?.ids ?? []).length == 1} {#if (token?.ids ?? []).length == 1}
<Source id={token.ids[0] - 1} title={sourceIds[token.ids[0] - 1]} {onClick} /> <Source id={token.ids[0] - 1} title={sourceIds[token.ids[0] - 1]} {onClick} />

View file

@ -422,7 +422,7 @@
// Helper function to maintain file paths within zip // Helper function to maintain file paths within zip
const syncDirectoryHandler = async () => { const syncDirectoryHandler = async () => {
if ((knowledge?.files ?? []).length > 0) { if (fileItems.length > 0) {
const res = await resetKnowledgeById(localStorage.token, id).catch((e) => { const res = await resetKnowledgeById(localStorage.token, id).catch((e) => {
toast.error(`${e}`); toast.error(`${e}`);
}); });
@ -757,10 +757,10 @@
/> />
<div class="shrink-0 mr-2.5"> <div class="shrink-0 mr-2.5">
{#if (knowledge?.files ?? []).length} {#if fileItemsTotal}
<div class="text-xs text-gray-500"> <div class="text-xs text-gray-500">
{$i18n.t('{{count}} files', { {$i18n.t('{{count}} files', {
count: (knowledge?.files ?? []).length count: fileItemsTotal
})} })}
</div> </div>
{/if} {/if}