File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,10 @@ <h1 class="py-4">{{ .Title }}</h1>
112112 const resultsLength = search . results . length ;
113113 // Get the data for the search results
114114 // Slice the results based on the range start + 10
115- const resultsData = await Promise . all (
116- search . results . slice ( rangeStart , rangeEnd ) . map ( ( r ) => r . data ( ) ) ,
115+ const fullResultsData = await Promise . all (
116+ search . results . map ( ( r ) => r . data ( ) )
117117 ) ;
118+ const resultsData = fullResultsData . slice ( rangeStart , rangeEnd ) ;
118119 // If the range does not have any results, display a message
119120 if ( resultsData . length === 0 ) {
120121 searchPageResults . innerHTML = `<div class="p-4">No results found</div>` ;
@@ -123,7 +124,7 @@ <h1 class="py-4">{{ .Title }}</h1>
123124 // Add an index to the results, for heap tracking
124125 const results = resultsData . map ( ( item , index ) => ( {
125126 ...item ,
126- index : index + 1 ,
127+ index : rangeStart + index + 1 ,
127128 } ) ) ;
128129
129130 // If the query is not empty, display the search results container
You can’t perform that action at this time.
0 commit comments