Fix zoom resizing, add multi page support, fix text box bugs, fix broken upload button
Some checks failed
Automated Container Build / build-and-push (push) Failing after 3s
CI / Backend (Python) (push) Failing after 11s
CI / Frontend (TypeScript) (push) Failing after 4m49s

This commit is contained in:
Elijah 2026-06-13 12:55:30 -07:00
parent 5b2140187f
commit 7ff5c8130d
3 changed files with 113 additions and 30 deletions

View file

@ -138,12 +138,20 @@ export const LibraryHeader = ({ currentTab, onTabChange }: { currentTab: 'librar
accept="application/pdf"
multiple
className="hidden"
onChange={(e) => {
const uploader = document.querySelector('input[type="file"][multiple]') as HTMLInputElement
if (uploader && uploader !== e.target) {
uploader.files = e.target.files
const event = new Event('change', { bubbles: true })
uploader.dispatchEvent(event)
onChange={async (e) => {
if (e.target.files && e.target.files.length > 0) {
const files = e.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
if (file.type === 'application/pdf') {
try {
await useLibrary.getState().uploadDocument(file);
} catch (err) {
console.error('Failed to upload', file.name, err);
}
}
}
e.target.value = '';
}
}}
/>