File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -126,21 +126,15 @@ class PDFRenderingQueue {
126126 }
127127 }
128128
129- // All the visible views have rendered; try to render next/previous pages.
130- if ( scrolledDown ) {
131- const nextPageIndex = visible . last . id ;
132- // IDs start at 1, so no need to add 1.
133- if ( views [ nextPageIndex ] && ! this . isViewFinished ( views [ nextPageIndex ] ) ) {
134- return views [ nextPageIndex ] ;
135- }
136- } else {
137- const previousPageIndex = visible . first . id - 2 ;
138- if (
139- views [ previousPageIndex ] &&
140- ! this . isViewFinished ( views [ previousPageIndex ] )
141- ) {
142- return views [ previousPageIndex ] ;
143- }
129+ // All the visible views have rendered; try to render next/previous page.
130+ // (IDs start at 1, so no need to add 1 when `scrolledDown === true`.)
131+ const preRenderIndex = scrolledDown
132+ ? visible . last . id
133+ : visible . first . id - 2 ;
134+ const preRenderView = views [ preRenderIndex ] ;
135+
136+ if ( preRenderView && ! this . isViewFinished ( preRenderView ) ) {
137+ return preRenderView ;
144138 }
145139 // Everything that needs to be rendered has been.
146140 return null ;
You can’t perform that action at this time.
0 commit comments