fix(pdf): make isLoaded reactive so nav buttons are enabled after load
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m50s
CI / Backend Unit Tests (push) Failing after 2m47s

pdfDoc was a plain variable (not \$state), so renderer.isLoaded had no
reactive dependencies in Svelte 5. PdfControls received isLoaded=false
permanently, keeping the next-page button disabled while zoom buttons
(which have no disabled attribute) still worked.

Fix: derive isLoaded from totalPages (\$state) via totalPages > 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-17 15:55:42 +02:00
parent 4cb7c975f5
commit 9a64c0698f

View File

@@ -183,7 +183,7 @@ export function createPdfRenderer() {
return error;
},
get isLoaded() {
return pdfDoc !== null;
return totalPages > 0;
},
get pdfjsReady() {
return pdfjsReady;