File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/routes/page/knowledge-base/documents Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11<script >
22 import KnowledgeUploadResult from ' ./knowledge-upload-result.svelte' ;
33 import { onMount , onDestroy , createEventDispatcher } from ' svelte' ;
4- import util from " lodash" ;
54 import { fly } from ' svelte/transition' ;
65 import { Tooltip , Button , Input } from ' @sveltestrap/sveltestrap' ;
76 import { PUBLIC_SERVICE_URL } from ' $env/static/public' ;
1312 import LoadingDots from ' $lib/common/LoadingDots.svelte' ;
1413 import { isExternalUrl } from ' $lib/helpers/utils/common' ;
1514 import { knowledgeBaseDocumentStore , userStore } from ' $lib/helpers/store' ;
15+ import { KnowledgeDocSource } from ' $lib/helpers/enums' ;
1616 import {
1717 getKnowledgeDocuments ,
1818 uploadKnowledgeDocuments ,
1919 deleteKnowledgeDocument
2020 } from ' $lib/services/knowledge-base-service' ;
21- import { KnowledgeDocSource } from ' $lib/helpers/enums' ;
22-
2321
2422 const svelteDispatch = createEventDispatcher ();
2523
2624 const accept = " .txt" ;
2725 const acceptDisplayList = " txt" ;
2826 const fileMaxSize = 10 * 1024 * 1024 ;
2927 const startPage = 1 ;
30- const docPageSize = 1 ;
28+ const docPageSize = 8 ;
3129
3230 const options = {
3331 scrollbars: {
290288 function unique(files) {
291289 if (!files) return [];
292290
293- return util.uniqBy(files, (/** @type {any} */ x) => x.file_id);
291+ const map = new Map();
292+ return files.filter(x => !map.has(x.file_id) && map.set(x.file_id, 1));
294293 }
295294</script>
296295
You can’t perform that action at this time.
0 commit comments