My Documents
{#if $documents.length === 0 || dragged}
{:else} {#each $documents.filter((p) => query === '' || p.name.includes(query)) as doc}
{/each} {/if}
{#if $documents.length != 0}
{ console.log(importFiles); const reader = new FileReader(); reader.onload = async (event) => { const savedDocs = JSON.parse(event.target.result); console.log(savedDocs); for (const doc of savedDocs) { await createNewDoc( localStorage.token, doc.collection_name, doc.filename, doc.name, doc.title ).catch((error) => { toast.error(error); return null; }); } await documents.set(await getDocs(localStorage.token)); }; reader.readAsText(importFiles[0]); }} />
{/if}