fix(pdf): make isLoaded reactive so nav buttons are enabled after load
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:
@@ -183,7 +183,7 @@ export function createPdfRenderer() {
|
||||
return error;
|
||||
},
|
||||
get isLoaded() {
|
||||
return pdfDoc !== null;
|
||||
return totalPages > 0;
|
||||
},
|
||||
get pdfjsReady() {
|
||||
return pdfjsReady;
|
||||
|
||||
Reference in New Issue
Block a user